private InetSocketAddress remoteAddress(Request request, Uri uri, ProxyServer proxy, boolean useProxy) throws UnknownHostException { InetAddress address; int port = getDefaultPort(uri); if (request.getInetAddress() != null) { address = request.getInetAddress(); } else if (!useProxy || avoidProxy(proxy, uri.getHost())) { address = request.getNameResolver().resolve(uri.getHost()); } else { address = request.getNameResolver().resolve(proxy.getHost()); port = proxy.getPort(); } return new InetSocketAddress(address, port); }
final String partitionId = getPartitionId(request.getInetAddress(), request, proxy); Endpoint endpoint = endpointMap.get(partitionId); if (endpoint == null) { endpoint = new AhcEndpoint(partitionId, isSecure, request.getInetAddress(), host, port, request.getLocalAddress(), defaultConnectionHandler);
final String partitionId = getPartitionId(request.getInetAddress(), request, proxy); Endpoint endpoint = endpointMap.get(partitionId); if (endpoint == null) { final boolean isSecure = Utils.isSecure(scheme); endpoint = new AhcEndpoint(partitionId, isSecure, request.getInetAddress(), host, port, request.getLocalAddress(), defaultConnectionHandler);
@Override public InetAddress getInetAddress() { return delegate.getInetAddress(); }
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getUri(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.compositeByteData = prototype.getCompositeByteData(); this.stringData = prototype.getStringData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirects = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyEncoding(); this.connectionPoolPartitioning = prototype.getConnectionPoolPartitioning(); this.nameResolver = prototype.getNameResolver(); } }
private InetSocketAddress remoteAddress(Request request, UriComponents uri, ProxyServer proxy, boolean useProxy) { if (request.getInetAddress() != null) return new InetSocketAddress(request.getInetAddress(), getDefaultPort(uri)); else if (!useProxy || avoidProxy(proxy, uri.getHost())) return new InetSocketAddress(uri.getHost(), getDefaultPort(uri)); else return new InetSocketAddress(proxy.getHost(), proxy.getPort()); }
final String partitionId = getPartitionId(request.getInetAddress(), request, proxy); Endpoint endpoint = endpointMap.get(partitionId); if (endpoint == null) { endpoint = new AhcEndpoint(partitionId, isSecure, request.getInetAddress(), host, port, request.getLocalAddress(), defaultConnectionHandler);
final String partitionId = getPartitionId(request.getInetAddress(), request, proxy); Endpoint endpoint = endpointMap.get(partitionId); if (endpoint == null) { endpoint = new AhcEndpoint(partitionId, isSecure, request.getInetAddress(), host, port, request.getLocalAddress(), defaultConnectionHandler);
final String partitionId = getPartitionId(request.getInetAddress(), request, proxy); Endpoint endpoint = endpointMap.get(partitionId); if (endpoint == null) { final boolean isSecure = Utils.isSecure(scheme); endpoint = new AhcEndpoint(partitionId, isSecure, request.getInetAddress(), host, port, request.getLocalAddress(), defaultConnectionHandler);
final String partitionId = getPartitionId(request.getInetAddress(), request, proxy); Endpoint endpoint = endpointMap.get(partitionId); if (endpoint == null) { final boolean isSecure = Utils.isSecure(scheme); endpoint = new AhcEndpoint(partitionId, isSecure, request.getInetAddress(), host, port, request.getLocalAddress(), defaultConnectionHandler);
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getURI(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<Cookie>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.stringData = prototype.getStringData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<Param>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<Part>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirects = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyEncoding(); this.connectionPoolKeyStrategy = prototype.getConnectionPoolKeyStrategy(); } }
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getUri(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.compositeByteData = prototype.getCompositeByteData(); this.stringData = prototype.getStringData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirects = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyEncoding(); this.connectionPoolPartitioning = prototype.getConnectionPoolPartitioning(); this.nameResolver = prototype.getNameResolver(); } }
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getUri(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.compositeByteData = prototype.getCompositeByteData(); this.stringData = prototype.getStringData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirects = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyEncoding(); this.connectionPoolPartitioning = prototype.getConnectionPoolPartitioning(); this.nameResolver = prototype.getNameResolver(); } }