/** * Called after a socket connection has been created or retrieved from the * pool. Subclasses use this hook to get a reference to the TLS data. */ protected void connected(Connection connection) { policy.setSelectedProxy(connection.getRoute().getProxy()); connected = true; }
/** * Called after a socket connection has been created or retrieved from the * pool. Subclasses use this hook to get a reference to the TLS data. */ protected void connected(Connection connection) { policy.setSelectedProxy(connection.getRoute().getProxy()); connected = true; }
/** * Returns true if the request line should contain the full URL with host * and port (like "GET http://android.com/foo HTTP/1.1") or only the path * (like "GET /foo HTTP/1.1"). * * <p>This is non-final because for HTTPS it's never necessary to supply the * full URL, even if a proxy is in use. */ protected boolean includeAuthorityInRequestLine() { return connection == null ? policy.usingProxy() // A proxy was requested. : connection.getRoute().getProxy().type() == Proxy.Type.HTTP; // A proxy was selected. }
/** * Returns true if the request line should contain the full URL with host * and port (like "GET http://android.com/foo HTTP/1.1") or only the path * (like "GET /foo HTTP/1.1"). * * <p>This is non-final because for HTTPS it's never necessary to supply the * full URL, even if a proxy is in use. */ protected boolean includeAuthorityInRequestLine() { return connection == null ? policy.usingProxy() // A proxy was requested. : connection.getRoute().getProxy().type() == Proxy.Type.HTTP; // A proxy was selected. }
i.hasPrevious(); ) { Connection connection = i.previous(); if (!connection.getRoute().getAddress().equals(address) || !connection.isAlive() || System.nanoTime() - connection.getIdleStartTimeNs() >= keepAliveDurationNs) {
i.hasPrevious(); ) { Connection connection = i.previous(); if (!connection.getRoute().getAddress().equals(address) || !connection.isAlive() || System.nanoTime() - connection.getIdleStartTimeNs() >= keepAliveDurationNs) {
/** * Clients should invoke this method when they encounter a connectivity * failure on a connection returned by this route selector. */ public void connectFailed(Connection connection, IOException failure) { Route failedRoute = connection.getRoute(); if (failedRoute.getProxy().type() != Proxy.Type.DIRECT && proxySelector != null) { // Tell the proxy selector when we fail to connect on a fresh connection. proxySelector.connectFailed(uri, failedRoute.getProxy().address(), failure); } routeDatabase.failed(failedRoute, failure); }
? httpEngine.connection.getRoute().getProxy() : client.getProxy(); final int responseCode = getResponseCode();
/** * Clients should invoke this method when they encounter a connectivity * failure on a connection returned by this route selector. */ public void connectFailed(Connection connection, IOException failure) { Route failedRoute = connection.getRoute(); if (failedRoute.getProxy().type() != Proxy.Type.DIRECT && proxySelector != null) { // Tell the proxy selector when we fail to connect on a fresh connection. proxySelector.connectFailed(uri, failedRoute.getProxy().address(), failure); } routeDatabase.failed(failedRoute, failure); }
? httpEngine.connection.getRoute().getProxy() : client.getProxy(); final int responseCode = getResponseCode();
connection.connect(client.getConnectTimeout(), client.getReadTimeout(), getTunnelConfig()); client.getConnectionPool().maybeShare(connection); client.getRoutesDatabase().connected(connection.getRoute()); } else { connection.updateReadTimeout(client.getReadTimeout()); if (connection.getRoute().getProxy() != client.getProxy()) {
connection.connect(client.getConnectTimeout(), client.getReadTimeout(), getTunnelConfig()); client.getConnectionPool().maybeShare(connection); client.getRoutesDatabase().connected(connection.getRoute()); } else { connection.updateReadTimeout(client.getReadTimeout()); if (connection.getRoute().getProxy() != client.getProxy()) {