hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19286] - httpClient incorrectly closing tunnelled connection right after tunnell established
Date Fri, 25 Apr 2003 00:33:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19286>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19286

httpClient incorrectly closing tunnelled connection right after tunnell established





------- Additional Comments From becke@u.washington.edu  2003-04-25 00:33 -------
Attached above is a patch that should fix this.  The problem in this case was that isStale()
was 
being called on connections that were not yet used.  Though this is generally a legitimate
thing to 
do, it does not go too well with JSSE and some JVMs.  This patch just changes isOpen() to
only call 
isStale() on used connections.  Here are the following use cases and the new behaviors:

1) HTTP, HTTPS + JVM >= 1.4 - connections are used and reused until closed or until the

connection becomes stale.  This continues to work as planned.
2) HTTPS + JVM < 1.4 - connections are used once and will be made stale by the resulting
call to 
isStale() when reused.  isStale() breaks HTTPS connections pre 1.4 which causes them to be
closed.  
Though it is unfortunate that these connections cannot be reused, it is okay since they can
still be 
reliably determined to be stale.
3) HTTPS + proxy - connections can only be used once in this scenario as they are closed by

HttpConnection.releaseConnection().  This is due to a design flaw and will be fixed in 2.1
or so.

One thing I did not do was close HTTPS pre-1.4 connections when released.  This is mostly

because this is handled by isStale() when reused.  Also, there may be some combination of
JVM, 
JSSE and platform where isStale() will work, that we are unable to test.  Anyway, if people
don't like 
this we can add another case to releaseConnection() that will take care of this.

Mike

Mime
View raw message