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

Satoshi Nakamura commented on HTTPCLIENT-647:
---------------------------------------------

After a server disconnects a connection after sending 407 response, isOpen() 
continues to return true because it doesn't care the server disconnects. When 
closeIfStale() is called, it detects that the server disconnected the 
connection and resets isOpen flag to false. At this time isOpen() returns false 
so that it tries to reopen a connection again. Without this, it tries to write 
to the closed connection and throws IOException.

I'll post logs later.


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