hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject PATCH: HttpConnection cleanup
Date Sun, 02 Nov 2003 16:07:27 GMT

This patch has been prompted by the questions/concerns raised by Fabio
<linea at libero.it>. Let's face it, HttpConnection has got a bit messy
with all the numerous changes made recently. In particular the exception
handling especially with regards to handling recoverable exceptions and
timeouts got muddy. This patch attempts to address the problem


- Socket input stream now wrapped with a wrapper class that re-throws
certain type of generic IO exceptions as HttpClient specific exceptions.
In particular java.io.InterruptedIOExceptions are re-thrown as
- java.io.InterruptedIOExceptions in HttpConnection#open() re-thrown as
- HttpConnection#write(byte[], int, int) used to throw
HttpRecoverableException in case of getting absolutely messed up
parameters. changed to throw IllegalArgumentException instead
- HttpConnection#write(byte[], int, int) does not do any exception
handling anymore, since this is clearly a prerogative of the
- 'used' flag in HttpConnection was set to true only upon the connection
release. Why? Was there any reason for this kind of behavior? That doest
not seem right to me. Changed to set 'used' flag upon first successful
write operation. Mike, please have a close look. Let me know if you
disagree with the change. It can well be that I missed something
- close() and flush() in WrappedOutputStream no longer throw
HttpRecoverableExceptions. I believe this kind of exceptions are too
severe to be automatically recovered from

Let me know what you think


View raw message