/** * This procedure handles all retransmits, if any. * * @throws IOException */ protected void handleRetransmits() throws IOException { // If we have a cachedStream, we are caching the request. if (cachedStream != null || getClient().isAutoRedirect() && KNOWN_HTTP_VERBS_WITH_NO_CONTENT.contains(getMethod()) || authSupplier != null && authSupplier.requiresRequestCaching()) { if (LOG.isLoggable(Level.FINE) && cachedStream != null) { StringBuilder b = new StringBuilder(4096); b.append("Conduit \"").append(getConduitName()) .append("\" Transmit cached message to: ") .append(url) .append(": "); cachedStream.writeCacheTo(b, 16L * 1024L); LOG.fine(b.toString()); } int maxRetransmits = getMaxRetransmits(); updateCookiesBeforeRetransmit(); int nretransmits = 0; while ((maxRetransmits < 0 || nretransmits < maxRetransmits) && processRetransmit()) { nretransmits++; } } } /**
protected boolean redirectRetransmit() throws IOException { if (!getClient(outMessage).isAutoRedirect()) { return false;
+ " We must cache request."); if (csPolicy.isAutoRedirect()) { needToCacheRequest = true; LOG.log(Level.FINE, "AutoRedirect is turned on.");
&& (p1.isAutoRedirect() == p2.isAutoRedirect()) && StringUtils.equals(p1.getAccept(), p2.getAccept()) && StringUtils.equals(p1.getAcceptEncoding(), p2.getAcceptEncoding())
compatible &= !p1.isSetAutoRedirect() || !p2.isSetAutoRedirect() || p1.isAutoRedirect() == p2.isAutoRedirect();
/** * This procedure handles all retransmits, if any. * * @throws IOException */ protected void handleRetransmits() throws IOException { // If we have a cachedStream, we are caching the request. if (cachedStream != null || getClient().isAutoRedirect() && KNOWN_HTTP_VERBS_WITH_NO_CONTENT.contains(getMethod()) || authSupplier != null && authSupplier.requiresRequestCaching()) { if (LOG.isLoggable(Level.FINE) && cachedStream != null) { StringBuilder b = new StringBuilder(4096); b.append("Conduit \"").append(getConduitName()) .append("\" Transmit cached message to: ") .append(url) .append(": "); cachedStream.writeCacheTo(b, 16L * 1024L); LOG.fine(b.toString()); } int maxRetransmits = getMaxRetransmits(); updateCookiesBeforeRetransmit(); int nretransmits = 0; while ((maxRetransmits < 0 || nretransmits < maxRetransmits) && processRetransmit()) { nretransmits++; } } } /**
/** * This procedure handles all retransmits, if any. * * @throws IOException */ protected void handleRetransmits() throws IOException { // If we have a cachedStream, we are caching the request. if (cachedStream != null || getClient().isAutoRedirect() && KNOWN_HTTP_VERBS_WITH_NO_CONTENT.contains(getMethod()) || authSupplier != null && authSupplier.requiresRequestCaching()) { if (LOG.isLoggable(Level.FINE) && cachedStream != null) { StringBuilder b = new StringBuilder(4096); b.append("Conduit \"").append(getConduitName()) .append("\" Transmit cached message to: ") .append(url) .append(": "); cachedStream.writeCacheTo(b, 16 * 1024); LOG.fine(b.toString()); } int maxRetransmits = getMaxRetransmits(); updateCookiesBeforeRetransmit(); int nretransmits = 0; while ((maxRetransmits < 0 || nretransmits < maxRetransmits) && processRetransmit()) { nretransmits++; } } } /**
p.setAutoRedirect(p1.isAutoRedirect()); } else if (p2.isSetAutoRedirect()) { p.setAutoRedirect(p2.isAutoRedirect());
protected boolean redirectRetransmit() throws IOException { if (!getClient(outMessage).isAutoRedirect()) { return false;
protected boolean redirectRetransmit() throws IOException { if (!getClient(outMessage).isAutoRedirect()) { return false;
+ " We must cache request."); if (csPolicy.isAutoRedirect()) { needToCacheRequest = true; LOG.log(Level.FINE, "AutoRedirect is turned on.");
+ " We must cache request."); if (csPolicy.isAutoRedirect()) { needToCacheRequest = true; LOG.log(Level.FINE, "AutoRedirect is turned on.");
compatible &= p1.isAutoRedirect() == p2.isAutoRedirect();
&& (p1.isAutoRedirect() == p2.isAutoRedirect()) && StringUtils.equals(p1.getAccept(), p2.getAccept()) && StringUtils.equals(p1.getAcceptEncoding(), p2.getAcceptEncoding())
&& (p1.isAutoRedirect() == p2.isAutoRedirect()) && StringUtils.equals(p1.getAccept(), p2.getAccept()) && StringUtils.equals(p1.getAcceptEncoding(), p2.getAcceptEncoding())
compatible &= !p1.isSetAutoRedirect() || !p2.isSetAutoRedirect() || p1.isAutoRedirect() == p2.isAutoRedirect();
private void verifyBethalClient(Greeter bethal) { Client client = ClientProxy.getClient(bethal); HTTPConduit http = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = http.getClient(); assertEquals("the httpClientPolicy's autoRedirect should be true", true, httpClientPolicy.isAutoRedirect()); TLSClientParameters tlsParameters = http.getTlsClientParameters(); assertNotNull("the http conduit's tlsParameters should not be null", tlsParameters); // If we set any name, but Edward, Mary, or George, // and a password of "password" we will get through // Bethal. AuthorizationPolicy authPolicy = http.getAuthorization(); assertEquals("Set the wrong user name from the configuration", "Betty", authPolicy.getUserName()); assertEquals("Set the wrong pass word form the configuration", "password", authPolicy.getPassword()); configureProxy(ClientProxy.getClient(bethal)); String answer = bethal.sayHi(); answer = bethal.sayHi(); answer = bethal.sayHi(); answer = bethal.sayHi(); answer = bethal.sayHi(); assertTrue("Unexpected answer: " + answer, "Bonjour from Bethal".equals(answer)); //With HTTPS, it will just be a CONNECT to the proxy and all the //data is encrypted. Thus, the proxy cannot distinquish the requests assertProxyRequestCount(0); }
p.setAutoRedirect(p1.isAutoRedirect()); } else if (p2.isSetAutoRedirect()) { p.setAutoRedirect(p2.isAutoRedirect());
p.setAutoRedirect(p1.isAutoRedirect()); } else if (p2.isSetAutoRedirect()) { p.setAutoRedirect(p2.isAutoRedirect());