Folks, any feedback to this one so far? Oleg
-----Original Message----- From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] Sent: Sunday, November 02, 2003 17:07 To: Jakarata Commons HttpClient mailing list Subject: PATCH: HttpConnection cleanup Folks, 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 changelog: - 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 IOTimeoutException - java.io.InterruptedIOExceptions in HttpConnection#open() re-thrown as ConnectTimeoutException - 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 WrappedOutputStream - '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 important. - 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 Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]