Roland,
I would like to make sure the connection gets auto-released if an
IOException is thrown. I think this patch should take care of that.
Please review and let me know if it is okay to check the patch in.
Cheers
Oleg
Index: /home/oleg/src/apache.org/jakarta/httpcomponents/httpclient/module-client/src/main/java/org/apache/http/conn/EofSensorInputStream.java
===================================================================
--- /home/oleg/src/apache.org/jakarta/httpcomponents/httpclient/module-client/src/main/java/org/apache/http/conn/EofSensorInputStream.java (revision 552157)
+++ /home/oleg/src/apache.org/jakarta/httpcomponents/httpclient/module-client/src/main/java/org/apache/http/conn/EofSensorInputStream.java (working copy)
@@ -135,8 +135,13 @@
int l = -1;
if (isReadAllowed()) {
- l = wrappedStream.read();
- checkEOF(l);
+ try {
+ l = wrappedStream.read();
+ checkEOF(l);
+ } catch (IOException ex) {
+ checkAbort();
+ throw ex;
+ }
}
return l;
@@ -148,8 +153,13 @@
int l = -1;
if (isReadAllowed()) {
- l = wrappedStream.read(b, off, len);
- checkEOF(l);
+ try {
+ l = wrappedStream.read(b, off, len);
+ checkEOF(l);
+ } catch (IOException ex) {
+ checkAbort();
+ throw ex;
+ }
}
return l;
@@ -161,8 +171,13 @@
int l = -1;
if (isReadAllowed()) {
- l = wrappedStream.read(b);
- checkEOF(l);
+ try {
+ l = wrappedStream.read(b);
+ checkEOF(l);
+ } catch (IOException ex) {
+ checkAbort();
+ throw ex;
+ }
}
return l;
}
@@ -173,8 +188,13 @@
int a = 0; // not -1
if (isReadAllowed()) {
- a = wrappedStream.available();
- // no checkEOF() here, available() can't trigger EOF
+ try {
+ a = wrappedStream.available();
+ // no checkEOF() here, available() can't trigger EOF
+ } catch (IOException ex) {
+ checkAbort();
+ throw ex;
+ }
}
return a;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]