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/java/org/apache/commons/httpclient HttpClient.java
Date Tue, 25 Feb 2003 09:13:56 GMT
oglueck     2003/02/25 01:13:56

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpClient.java
  Log:
  backing out my erronous patch
  
  Revision  Changes    Path
  1.71      +13 -8     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java
  
  Index: HttpClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- HttpClient.java	24 Feb 2003 19:12:06 -0000	1.70
  +++ HttpClient.java	25 Feb 2003 09:13:55 -0000	1.71
  @@ -552,6 +552,11 @@
           );
   
           try {
  +            // Catch all possible exceptions to make sure to release the 
  +            // connection, as although the user may call 
  +            // Method->releaseConnection(), the method doesn't know about the
  +            // connection until HttpMethod.execute() is called.
  +            
               method.setStrictMode(strictMode);
           
               if (!connection.isOpen()) {
  @@ -562,12 +567,12 @@
                       method = new ConnectMethod(method);
                   }
               }
  -        } finally {
  -            // make sure to release the 
  -            // connection, as although the user may call 
  -            // Method->releaseConnection(), the method doesn't know about the
  -            // connection until HttpMethod.execute() is called.
  +        } catch (IOException e) {
  +            connection.releaseConnection();
  +            throw e;
  +        } catch (RuntimeException e) {
               connection.releaseConnection();
  +            throw e;
           }
           
           return method.execute(state, connection);
  
  
  

---------------------------------------------------------------------
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