Workaround a bug in state management of re-opened connections in HttpCore
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1483844 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
29ffce391c
commit
87d5a1dce9
|
@ -274,12 +274,12 @@ public class MainClientExec implements ClientExecChain {
|
||||||
|
|
||||||
if (needAuthentication(
|
if (needAuthentication(
|
||||||
targetAuthState, proxyAuthState, route, request, response, context)) {
|
targetAuthState, proxyAuthState, route, request, response, context)) {
|
||||||
|
// Make sure the response body is fully consumed, if present
|
||||||
|
final HttpEntity entity = response.getEntity();
|
||||||
|
EntityUtils.consume(entity);
|
||||||
if (connHolder.isReusable()) {
|
if (connHolder.isReusable()) {
|
||||||
// Make sure the response body is fully consumed, if present
|
// TODO consume response body on if connection is re-usable
|
||||||
final HttpEntity entity = response.getEntity();
|
// (requires post 4.3-beta2 bug fix in HttpCore)
|
||||||
EntityUtils.consume(entity);
|
|
||||||
// entity consumed above is not an auto-release entity,
|
|
||||||
// need to mark the connection re-usable explicitly
|
|
||||||
} else {
|
} else {
|
||||||
managedConn.close();
|
managedConn.close();
|
||||||
if (proxyAuthState.getState() == AuthProtocolState.SUCCESS
|
if (proxyAuthState.getState() == AuthProtocolState.SUCCESS
|
||||||
|
|
Loading…
Reference in New Issue