private Channel pollPooledChannel(Request request, ProxyServer proxy, AsyncHandler<?> asyncHandler) { try { asyncHandler.onConnectionPoolAttempt(); } catch (Exception e) { LOGGER.error("onConnectionPoolAttempt crashed", e); } Uri uri = request.getUri(); String virtualHost = request.getVirtualHost(); final Channel channel = channelManager.poll(uri, virtualHost, proxy, request.getChannelPoolPartitioning()); if (channel != null) { LOGGER.debug("Using pooled Channel '{}' for '{}' to '{}'", channel, request.getMethod(), uri); } return channel; }
private <T> NettyResponseFuture<T> newNettyResponseFuture(Request request, AsyncHandler<T> asyncHandler, NettyRequest nettyRequest, ProxyServer proxyServer) { NettyResponseFuture<T> future = new NettyResponseFuture<>( request, asyncHandler, nettyRequest, config.getMaxRequestRetry(), request.getChannelPoolPartitioning(), connectionSemaphore, proxyServer); String expectHeader = request.getHeaders().get(EXPECT); if (HttpHeaderValues.CONTINUE.contentEqualsIgnoreCase(expectHeader)) future.setDontWriteBodyBecauseExpectContinue(true); return future; }
this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getCharset(); this.channelPoolPartitioning = prototype.getChannelPoolPartitioning(); this.nameResolver = prototype.getNameResolver();
.setChannelPoolPartitioning(request.getChannelPoolPartitioning()) .setFollowRedirect(true) .setLocalAddress(request.getLocalAddress())