[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489675
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-647:
----------------------------------------------

> Although it doesn't httpclient's fault, I think it's still good to recover 
> from those illegal conditions using closeIfStale(). How do you feel about it? 

Satoshi,

The stale connection check is _very_ expensive in terms of performance (up to 
30ms per request) and I do not feel like adding workarounds to the stock 
version of HttpClient for all sorts of broken proxies out there. HttpClient 4.0 
should provide a means to override the default HTTP response interceptors and 
to inject custom processing logic intended to deal with various protocol 
violations on a case by case basis.   

Oleg

> https connection over proxy with auth fails
> -------------------------------------------
>
>                 Key: HTTPCLIENT-647
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-647
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: java version "1.6.0_01"
> Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
> Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
>            Reporter: Satoshi Nakamura
>         Attachments: commons-httpclient.log
>
>
> When I try to connect to a https server using a proxy which requires 
> authentication, httpclient fails. It is because the proxy server close the 
> connection after sending 407 response and httpclient doesn't reopen a 
> connection. The proxy server which I confirm that this issue occurs is 
> delegate 9.5.6.
> Here is a patch to fix this issue.
> diff -u -r 
> commons-httpclient-3.0.1/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
>  
> commons-httpclient-3.0.1.new/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
> --- 
> commons-httpclient-3.0.1/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
>    2006-05-07 10:22:22.000000000 +0900
> +++ 
> commons-httpclient-3.0.1.new/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
>        2007-04-17 20:06:11.453125000 +0900
> @@ -477,6 +477,9 @@
>          
>          int code;
>          for (;;) {
> +            if (this.conn.getParams().isStaleCheckingEnabled()) {
> +                this.conn.closeIfStale();
> +            }
>              if (!this.conn.isOpen()) {
>                  this.conn.open();
>              }

-- 
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]

Reply via email to