commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbe...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpConnection.java
Date Thu, 01 May 2003 23:12:35 GMT
mbecke      2003/05/01 16:12:34

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpConnection.java
  Log:
  Fixed possible infinite recursion.
  
  PR: 19494
  Submitted by: Michael Becke
  Reviewed by: Oleg Kalnichevski
  
  Revision  Changes    Path
  1.62      +13 -10    jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java
  
  Index: HttpConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- HttpConnection.java	1 May 2003 01:25:28 -0000	1.61
  +++ HttpConnection.java	1 May 2003 23:12:34 -0000	1.62
  @@ -1069,33 +1069,36 @@
           lastResponseInputStream = null;
   
           if (null != inputStream) {
  +            InputStream temp = inputStream;
  +            inputStream = null;
               try {
  -                inputStream.close();
  +                temp.close();
               } catch (Exception ex) {
                   LOG.debug("Exception caught when closing input", ex);
                   // ignored
               }
  -            inputStream = null;
           }
   
           if (null != outputStream) {
  +            OutputStream temp = outputStream;
  +            outputStream = null;
               try {
  -                outputStream.close();
  +                temp.close();
               } catch (Exception ex) {
                   LOG.debug("Exception caught when closing output", ex);
                   // ignored
               }
  -            outputStream = null;
           }
   
           if (null != socket) {
  +            Socket temp = socket;
  +            socket = null;
               try {
  -                socket.close();
  +                temp.close();
               } catch (Exception ex) {
                   LOG.debug("Exception caught when closing socket", ex);
                   // ignored
               }
  -            socket = null;
           }
           isOpen = false;
           tunnelEstablished = false;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message