[
https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551039
]
Oleg Kalnichevski commented on HTTPCLIENT-711:
----------------------------------------------
======================================
HttpHost targetHost = new HttpHost("www.google.com", 80);
HttpHost proxy = new HttpHost("localhost", 8080);
HttpRoute route = new HttpRoute(targetHost, null, proxy, false);
HttpGet httpget = new HttpGet("http://www.google.com");
RoutedRequest routedReq = new RoutedRequest.Impl(httpget, route);
System.out.println("executing request to " + route);
HttpResponse response = httpclient.execute(routedReq, null);
HttpEntity entity = response.getEntity();
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
if (entity != null) {
System.out.println("Response content length: " + entity.getContentLength());
System.out.println("Chunked?: " + entity.isChunked());
}
if (entity != null) {
entity.consumeContent();
}
======================================
======================================
executing request to
HttpRoute[{}->http://localhost:8080->http://www.google.com:80]
[DEBUG] SingleClientConnManager - SingleClientConnManager.getConnection:
HttpRoute[{}->http://localhost:8080->http://www.google.com:80]
[DEBUG] DefaultClientRequestDirector - Stale connection check
[DEBUG] RequestAddCookies - CookieSpec selected: compatibility
[DEBUG] DefaultClientRequestDirector - Attempt 1 to execute request
[DEBUG] wire - >> "GET http://www.google.com HTTP/1.1[EOL]"
[DEBUG] wire - >> "Host: www.google.com:80[EOL]"
[DEBUG] wire - >> "Connection: Keep-Alive[EOL]"
[DEBUG] wire - >> "User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)[EOL]"
[DEBUG] wire - >> "[EOL]"
[DEBUG] headers - >> GET http://www.google.com HTTP/1.1
[DEBUG] headers - >> Host: www.google.com:80
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] headers - >> User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)
[DEBUG] wire - << "HTTP/1.0 407 Proxy Authentication Required[EOL]"
[DEBUG] wire - << "Server: squid/2.5.STABLE13[EOL]"
[DEBUG] wire - << "Mime-Version: 1.0[EOL]"
[DEBUG] wire - << "Date: Wed, 12 Dec 2007 17:20:43 GMT[EOL]"
[DEBUG] wire - << "Content-Type: text/html[EOL]"
[DEBUG] wire - << "Content-Length: 1292[EOL]"
[DEBUG] wire - << "Expires: Wed, 12 Dec 2007 17:20:43 GMT[EOL]"
[DEBUG] wire - << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[EOL]"
[DEBUG] wire - << "Proxy-Authenticate: Basic realm="test-proxy"[EOL]"
[DEBUG] wire - << "X-Cache: MISS from localhost[EOL]"
[DEBUG] wire - << "Proxy-Connection: close[EOL]"
[DEBUG] headers - << HTTP/1.0 407 Proxy Authentication Required
[DEBUG] headers - << Server: squid/2.5.STABLE13
[DEBUG] headers - << Mime-Version: 1.0
[DEBUG] headers - << Date: Wed, 12 Dec 2007 17:20:43 GMT
[DEBUG] headers - << Content-Type: text/html
[DEBUG] headers - << Content-Length: 1292
[DEBUG] headers - << Expires: Wed, 12 Dec 2007 17:20:43 GMT
[DEBUG] headers - << X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
[DEBUG] headers - << Proxy-Authenticate: Basic realm="test-proxy"
[DEBUG] headers - << X-Cache: MISS from localhost
[DEBUG] headers - << Proxy-Connection: close
[DEBUG] DefaultClientRequestDirector - Proxy requested authentication
[DEBUG] AbstractAuthenticationHandler - Supported authentication schemes in the
order of preference: [digest, basic]
[DEBUG] AbstractAuthenticationHandler - Challenge for digest authentication
scheme not available
[DEBUG] AbstractAuthenticationHandler - basic authentication scheme selected
[DEBUG] DefaultClientRequestDirector - Authorization challenge processed
[DEBUG] DefaultClientRequestDirector - Authentication scope: BASIC
'test-proxy'@localhost:8080
[DEBUG] DefaultClientRequestDirector - Found credentials
[DEBUG] DefaultClientConnection - Connection closed
[DEBUG] DefaultClientRequestDirector - Stale connection check
[DEBUG] RequestAddCookies - CookieSpec selected: compatibility
[DEBUG] DefaultClientRequestDirector - Attempt 2 to execute request
[DEBUG] wire - >> "GET http://www.google.com HTTP/1.1[EOL]"
[DEBUG] wire - >> "Host: www.google.com:80[EOL]"
[DEBUG] wire - >> "Connection: Keep-Alive[EOL]"
[DEBUG] wire - >> "User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)[EOL]"
[DEBUG] wire - >> "Proxy-Authorization: Basic c3F1aWQ6c3F1aWQ=[EOL]"
[DEBUG] wire - >> "[EOL]"
[DEBUG] headers - >> GET http://www.google.com HTTP/1.1
[DEBUG] headers - >> Host: www.google.com:80
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] headers - >> User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)
[DEBUG] headers - >> Proxy-Authorization: Basic c3F1aWQ6c3F1aWQ=
[DEBUG] wire - << "HTTP/1.0 302 Moved Temporarily[EOL]"
[DEBUG] wire - << "Location: http://www.google.ch/[EOL]"
[DEBUG] wire - << "Cache-Control: private[EOL]"
[DEBUG] wire - << "Set-Cookie:
PREF=ID=52fb518e7ee097ab:TM=1197480041:LM=1197480041:S=a1pxJQbheNzl_ekF;
expires=Fri, 11-Dec-2009 17:20:41 GMT; path=/; domain=.google.com[EOL]"
[DEBUG] wire - << "Content-Type: text/html[EOL]"
[DEBUG] wire - << "Server: gws[EOL]"
[DEBUG] wire - << "Content-Length: 218[EOL]"
[DEBUG] wire - << "Date: Wed, 12 Dec 2007 17:20:41 GMT[EOL]"
[DEBUG] wire - << "X-Cache: MISS from localhost[EOL]"
[DEBUG] wire - << "Proxy-Connection: keep-alive[EOL]"
[DEBUG] headers - << HTTP/1.0 302 Moved Temporarily
[DEBUG] headers - << Location: http://www.google.ch/
[DEBUG] headers - << Cache-Control: private
[DEBUG] headers - << Set-Cookie:
PREF=ID=52fb518e7ee097ab:TM=1197480041:LM=1197480041:S=a1pxJQbheNzl_ekF;
expires=Fri, 11-Dec-2009 17:20:41 GMT; path=/; domain=.google.com
[DEBUG] headers - << Content-Type: text/html
[DEBUG] headers - << Server: gws
[DEBUG] headers - << Content-Length: 218
[DEBUG] headers - << Date: Wed, 12 Dec 2007 17:20:41 GMT
[DEBUG] headers - << X-Cache: MISS from localhost
[DEBUG] headers - << Proxy-Connection: keep-alive
[DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name:
PREF][name:
ID=52fb518e7ee097ab:TM=1197480041:LM=1197480041:S=a1pxJQbheNzl_ekF][domain:
.google.com][path: /][expiry: Fri Dec 11 18:20:41 GMT+01:00 2009]".
[DEBUG] DefaultRedirectHandler - Redirect requested to location
'http://www.google.ch/'
[DEBUG] DefaultClientRequestDirector - Redirecting to 'http://www.google.ch/'
via HttpRoute[{tl}->http://localhost:8080->http://www.google.ch]
[DEBUG] DefaultClientRequestDirector - Connection kept alive
[DEBUG] wire - << "<HTML><HEAD><meta http-equiv="content-type"
content="text/html;charset=utf-8">[\n]"
[DEBUG] wire - << "<TITLE>302 Moved</TITLE></HEAD><BODY>[\n]"
[DEBUG] wire - << "<H1>302 Moved</H1>[\n]"
[DEBUG] wire - << "The document has moved[\n]"
[DEBUG] wire - << "<A HREF="http://www.google.ch/">here</A>.[\r][\n]"
[DEBUG] wire - << "</BODY></HTML>[\r][\n]"
[DEBUG] SingleClientConnManager - Released connection open but not reusable.
[DEBUG] DefaultClientConnection - Connection shut down
[DEBUG] SingleClientConnManager - SingleClientConnManager.getConnection:
HttpRoute[{tl}->http://localhost:8080->http://www.google.ch]
[DEBUG] wire - >> "CONNECT www.google.ch:80 HTTP/1.1[EOL]"
[DEBUG] wire - >> "User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)[EOL]"
[DEBUG] wire - >> "Host: www.google.ch[EOL]"
[DEBUG] wire - >> "Proxy-Authorization: Basic c3F1aWQ6c3F1aWQ=[EOL]"
[DEBUG] wire - >> "[EOL]"
[DEBUG] headers - >> CONNECT www.google.ch:80 HTTP/1.1
[DEBUG] headers - >> User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)
[DEBUG] headers - >> Host: www.google.ch
[DEBUG] headers - >> Proxy-Authorization: Basic c3F1aWQ6c3F1aWQ=
[DEBUG] wire - << "HTTP/1.0 200 Connection established[EOL]"
[DEBUG] headers - << HTTP/1.0 200 Connection established
[DEBUG] DefaultClientRequestDirector - Tunnel to target created.
[DEBUG] SingleClientConnManager - Released connection open but not reusable.
[DEBUG] DefaultClientConnection - Connection shut down
Exception in thread "main" java.lang.IllegalArgumentException: Target scheme
(http) must have layered socket factory.
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.updateSecureConnection(DefaultClientConnectionOperator.java:184)
at
org.apache.http.impl.conn.AbstractPoolEntry.layerProtocol(AbstractPoolEntry.java:282)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.layerProtocol(AbstractPooledConnAdapter.java:148)
at
org.apache.http.impl.client.DefaultClientRequestDirector.establishRoute(DefaultClientRequestDirector.java:508)
at
org.apache.http.impl.client.DefaultClientRequestDirector.execute(DefaultClientRequestDirector.java:287)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:511)======================================
> BasicRouteDirector incorrectly calculates complex routes
> --------------------------------------------------------
>
> Key: HTTPCLIENT-711
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-711
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Affects Versions: 4.0 Alpha 2
> Reporter: Oleg Kalnichevski
> Priority: Critical
> Fix For: 4.0 Alpha 3
>
>
> BasicRouteDirector appears to miscalculate complex routes. Example to follow.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]