commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpMethodBase.java
Date Sat, 26 Apr 2003 10:26:05 GMT
olegk       2003/04/26 03:26:05

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpMethodBase.java
  Log:
  Minor adjustments to HttpMethodBase#shouldCloseConnection(HttpConnection) making it more
robust when dealing with non-compliant proxy servers
  
  Contributed by Oleg Kalnichevski
  
  Revision  Changes    Path
  1.138     +13 -7     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java
  
  Index: HttpMethodBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
  retrieving revision 1.137
  retrieving revision 1.138
  diff -u -r1.137 -r1.138
  --- HttpMethodBase.java	25 Apr 2003 18:03:28 -0000	1.137
  +++ HttpMethodBase.java	26 Apr 2003 10:26:05 -0000	1.138
  @@ -868,10 +868,16 @@
       protected boolean shouldCloseConnection(HttpConnection conn) {
   
           Header connectionHeader = null;
  -        if (conn.isTransparent()) {
  -            connectionHeader = getResponseHeader("connection");
  -        } else {
  +        // In case being connected via a proxy server
  +        if (!conn.isTransparent()) {
  +            // Check for 'proxy-connection' directive
               connectionHeader = getResponseHeader("proxy-connection");
  +        }
  +        // In all cases Check for 'connection' directive
  +        // some non-complaint proxy servers send it instread of
  +        // expected 'proxy-connection' directive
  +        if (connectionHeader == null) {
  +            connectionHeader = getResponseHeader("connection");
           }
           if (connectionHeader != null) {
               if (connectionHeader.getValue().equalsIgnoreCase("close")) {
  
  
  

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