You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2007/12/12 18:27:43 UTC

[jira] Created: (HTTPCLIENT-711) BasicRouteDirector incorrectly calculates complex routes

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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCLIENT-711) bad route computed for redirected requests

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551455 ] 

Oleg Kalnichevski commented on HTTPCLIENT-711:
----------------------------------------------

Sounds like a plan. +1 from me. Could you please also consider making changes to HttpRoute API too? I personally profoundly dislike boolean parameters, as I never manager to remember what is true and what is false in each particular case. Three boolean parameters in a row just kill me. Could we use enumerations instead or some such?    

Oleg

> bad route computed for redirected requests
> ------------------------------------------
>
>                 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCLIENT-711) BasicRouteDirector incorrectly calculates complex routes

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Updated: (HTTPCLIENT-711) bad route computed for redirected requests

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Weber updated HTTPCLIENT-711:
------------------------------------

    Summary: bad route computed for redirected requests  (was: BasicRouteDirector incorrectly calculates complex routes)

> bad route computed for redirected requests
> ------------------------------------------
>
>                 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCLIENT-711) bad route computed for redirected requests

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551579 ] 

Roland Weber commented on HTTPCLIENT-711:
-----------------------------------------

Hi Oleg,

I haven't fixed the route computation for redirected requests, but I've completed all preliminary steps.
Maybe you can take it from here... it's getting late for me.

cheers,
  Roland


> bad route computed for redirected requests
> ------------------------------------------
>
>                 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-711) bad route computed for redirected requests

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551735 ] 

Oleg Kalnichevski commented on HTTPCLIENT-711:
----------------------------------------------

I can take it over from here

Oleg

> bad route computed for redirected requests
> ------------------------------------------
>
>                 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCLIENT-711) BasicRouteDirector incorrectly calculates complex routes

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551044 ] 

Roland Weber commented on HTTPCLIENT-711:
-----------------------------------------

Yepp, have a look at impl.conn.DefaultHttpRoutePlanner:

        Scheme schm = this.connectionManager.getSchemeRegistry().
            getScheme(target.getSchemeName());
        // as it is typically used for TLS/SSL, we assume that
        // a layered scheme implies a secure connection
        boolean secure = schm.isLayered();

        HttpRoute route = null;
        if (proxy == null) {
            route = new HttpRoute(target, null, secure);
        } else {
            route = new HttpRoute(target, null, proxy, secure);
        }

And the constructor of Scheme has:

        this.layered = (factory instanceof LayeredSocketFactory);

cheers,
  Roland


> 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCLIENT-711) bad route computed for redirected requests

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551208 ] 

Roland Weber commented on HTTPCLIENT-711:
-----------------------------------------

on a related matter, this section indicates a bug in connection re-use handling:

[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. 

I've committed a change which I hope will fix this issue.

cheers,
  Roland


> bad route computed for redirected requests
> ------------------------------------------
>
>                 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCLIENT-711) bad route computed for redirected requests

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551205 ] 

Roland Weber commented on HTTPCLIENT-711:
-----------------------------------------

I suggest the following changes to address this problem:

1. remove HttpClient.execute(RouteRequest...) methods
    (optionally replace with HttpClient.execute(HttpRequest,HttpHost target,...) methods
2. change ClientRequestDirector to expect HttpRequest+HttpHost instead of RoutedRequest
3. change DefaultClientRequestDirector to expect a route planner in the constructor
4. move Abstract/DefaultHttpClient.determineRoute to the ClientRequestDirector
5. move RoutedRequest from the API to an impl package, or drop it altogether
    (it seems to have outlived it's usefulness in the API)

After 4, the request director can take care of all route planning for the original and followup requests.

The purpose of RoutedRequest was to allow application-defined routes. This can now be achieved by implementing a custom route planner and passing an application-defined route as request parameter or in the context. We can also consider to add this functionality to the default route planner.

cheers,
  Roland


> bad route computed for redirected requests
> ------------------------------------------
>
>                 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCLIENT-711) BasicRouteDirector incorrectly calculates complex routes

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551046 ] 

Roland Weber commented on HTTPCLIENT-711:
-----------------------------------------

Hmmm... it seems this is only half the story. The DefaultHttpRoutePlanner will use the same value for both "layered" and "secure", which is not what we are seeing in your log. The buggy code is in DefaultClientRequestDirector, method handleResponse:

            HttpRoute newRoute = new HttpRoute(
                    newTarget,
                    localAddress,
                    proxy,
                    schm.isLayered(),
                    (proxy != null),
                    (proxy != null));

The director should rather use the RoutePlanner from the client to compute the route for the redirected request.

cheers,
  Roland


> 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCLIENT-711) BasicRouteDirector incorrectly calculates complex routes

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551042 ] 

Roland Weber commented on HTTPCLIENT-711:
-----------------------------------------

Hi Oleg,

the problem is not the BasicRouteDirector. The problem is that the route for plain HTTP through the proxy is considered a layered route, although it should be a plain route. This could happen if you are using a LayeredSocketFactory for scheme "http". IIRC, the decision whether a route is layered is not based on the scheme name but on the factory type. I'll have a look at it.

cheers,
  Roland


> 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org