You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by og...@apache.org on 2002/10/11 14:32:30 UTC
cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient SimpleHttpConnection.java
oglueck 2002/10/11 05:32:30
Modified: httpclient/src/test/org/apache/commons/httpclient
SimpleHttpConnection.java
Log:
Close streams on close() to make tests more realistic.
Revision Changes Path
1.2 +9 -3 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/SimpleHttpConnection.java
Index: SimpleHttpConnection.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/SimpleHttpConnection.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SimpleHttpConnection.java 8 Aug 2002 14:51:19 -0000 1.1
+++ SimpleHttpConnection.java 11 Oct 2002 12:32:30 -0000 1.2
@@ -130,9 +130,15 @@
}
public void close() {
+ if (headerReader != null) {
+ try { headerReader.close(); } catch(IOException e) {}
headerReader = null;
+ }
+ if (bodyInputStream != null) {
+ try { bodyInputStream.close(); } catch(IOException e) {}
bodyInputStream = null;
}
+ }
public void write(byte[] data)
throws IOException, IllegalStateException, HttpRecoverableException {
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>