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:
parent
49ba9e65e6
commit
da00b07129
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue