|
57 | 57 | import org.asynchttpclient.AsyncHandler;
|
58 | 58 | import org.asynchttpclient.AsyncHttpClientConfig;
|
59 | 59 | import org.asynchttpclient.ConnectionPoolKeyStrategy;
|
| 60 | +import org.asynchttpclient.ProxyServer; |
60 | 61 | import org.asynchttpclient.providers.netty.Callback;
|
61 | 62 | import org.asynchttpclient.providers.netty.DiscardEvent;
|
62 | 63 | import org.asynchttpclient.providers.netty.NettyAsyncHttpProviderConfig;
|
63 | 64 | import org.asynchttpclient.providers.netty.future.NettyResponseFuture;
|
64 | 65 | import org.asynchttpclient.providers.netty.handler.NettyChannelHandler;
|
65 | 66 | import org.asynchttpclient.providers.netty.util.CleanupChannelGroup;
|
| 67 | +import org.asynchttpclient.util.AsyncHttpProviderUtils; |
66 | 68 | import org.asynchttpclient.util.SslUtils;
|
67 | 69 | import org.slf4j.Logger;
|
68 | 70 | import org.slf4j.LoggerFactory;
|
@@ -306,8 +308,7 @@ public Channel verifyChannelPipeline(Channel channel, String scheme) throws IOEx
|
306 | 308 |
|
307 | 309 | protected HttpClientCodec newHttpClientCodec() {
|
308 | 310 | if (nettyProviderConfig != null) {
|
309 |
| - return new HttpClientCodec(nettyProviderConfig.getMaxInitialLineLength(), nettyProviderConfig.getMaxHeaderSize(), nettyProviderConfig.getMaxChunkSize(), |
310 |
| - false); |
| 311 | + return new HttpClientCodec(nettyProviderConfig.getMaxInitialLineLength(), nettyProviderConfig.getMaxHeaderSize(), nettyProviderConfig.getMaxChunkSize(), false); |
311 | 312 |
|
312 | 313 | } else {
|
313 | 314 | return new HttpClientCodec();
|
@@ -444,8 +445,10 @@ public void call() throws Exception {
|
444 | 445 | }
|
445 | 446 |
|
446 | 447 | public String getPoolKey(NettyResponseFuture<?> future) {
|
447 |
| - URI uri = future.getProxyServer() != null ? future.getProxyServer().getURI() : future.getURI(); |
448 |
| - return future.getConnectionPoolKeyStrategy().getKey(uri); |
| 448 | + String serverPart = future.getConnectionPoolKeyStrategy().getKey(future.getURI()); |
| 449 | + |
| 450 | + ProxyServer proxy = future.getProxyServer(); |
| 451 | + return proxy != null ? AsyncHttpProviderUtils.getBaseUrl(proxy.getURI()) + serverPart : serverPart; |
449 | 452 | }
|
450 | 453 |
|
451 | 454 | public void removeAll(Channel channel) {
|
|
0 commit comments