Skip to content

Commit 7f56b8e

Browse files
committed
HTTPCLIENT-2357, regression: Classic HttpClient fails to release connect in case of a proxy authentication failure
1 parent 8958b36 commit 7f56b8e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ConnectExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private ClassicHttpResponse createTunnelToTarget(
293293
response.setEntity(new ByteArrayEntity(
294294
EntityUtils.toByteArray(entity, 4096),
295295
ContentType.parseLenient(entity.getContentType())));
296-
execRuntime.disconnectEndpoint();
296+
execRuntime.discardEndpoint();
297297
}
298298
return response;
299299
}

httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void testEstablishRouteViaProxyTunnelFailure() throws Exception {
218218

219219
final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
220220
exec.execute(request, scope, execChain);
221-
Mockito.verify(execRuntime, Mockito.atLeastOnce()).disconnectEndpoint();
221+
Mockito.verify(execRuntime, Mockito.atLeastOnce()).discardEndpoint();
222222
}
223223

224224
@Test

0 commit comments

Comments
 (0)