commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oglu...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient SimpleHttpConnection.java
Date Fri, 11 Oct 2002 12:32:30 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message