HTTPCLIENT-734: Set release trigger on a managed connection as soon as it is allocated by the connection manager

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@615584 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2008-01-27 12:07:42 +00:00
parent 49ba9e65e6
commit da00b07129
1 changed files with 5 additions and 4 deletions

View File

@ -292,6 +292,11 @@ public class DefaultClientRequestDirector
if (managedConn == null) {
managedConn = allocateConnection(route, timeout);
}
if (orig instanceof AbortableHttpRequest) {
((AbortableHttpRequest) orig).setReleaseTrigger(managedConn);
}
// Reopen connection if needed
if (!managedConn.isOpen()) {
managedConn.open(route, context, params);
@ -347,10 +352,6 @@ public class DefaultClientRequestDirector
proxyAuthState);
requestExec.preProcess(reqwrap, httpProcessor, context);
if (orig instanceof AbortableHttpRequest) {
((AbortableHttpRequest) orig).setReleaseTrigger(managedConn);
}
context.setAttribute(ExecutionContext.HTTP_REQUEST,
reqwrap);