hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: SocketException with invalid server
Date Fri, 20 Jun 2003 02:07:17 GMT
> Well I'm not really sure.  It appears that the HttpConnection class 
> thinks that it's still open but the underlying stream is actually 
> closed.  I'm just writing some tests to check this at the moment, but 
> I believe it has to be the case because in HttpMethodBase.writeRequest 
> at line 2179 we call conn.flushRequestStream which is what's causing 
> the exception.  However, immediately before that call if you add a 
> debug statement to check if the connection is open, conn.isOpen() 
> returns true.
> Have you been able to independently reproduce this problem?  I can 
> reproduce it on 1.4.1 on OS X and Windows 2000 but it's possible I'm 
> still screwing something up.

  Yup, I'm trying it on OS X and linux.  I think the problem is in 
HttpMethodBase.execute() in particular the following line:

     if (responseStream != null) {

Since there is no content length or chunking the response stream is not 
being wrapped and is therefore actually closed by the above code.  Take 
a look at AutoCloseInputStream.close().  I vaguely remember talking 
about this case when we added the connection release/reuse code.  I may 
be wrong but I think that the connection should be getting closed in 
this case as there is no safe way to consume the response.


View raw message