hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r167986 - /jakarta/httpclient/trunk/http-common/src/java/org/apache/http/executor/HttpRequestExecutor.java
Date Tue, 03 May 2005 20:37:16 GMT
Author: olegk
Date: Tue May  3 13:37:16 2005
New Revision: 167986

URL: http://svn.apache.org/viewcvs?rev=167986&view=rev
Log:
Made request and response parameters pick up executor's parameters as defaults

Modified:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/executor/HttpRequestExecutor.java

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/executor/HttpRequestExecutor.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/executor/HttpRequestExecutor.java?rev=167986&r1=167985&r2=167986&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/executor/HttpRequestExecutor.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/executor/HttpRequestExecutor.java
Tue May  3 13:37:16 2005
@@ -70,7 +70,11 @@
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
         this.params = params;
-        this.localContext = new BasicHttpContext(parentContext); 
+        this.localContext = new BasicHttpContext(parentContext);
+    }
+    
+    public HttpRequestExecutor(final HttpParams params) {
+        this(params, null);
     }
     
     private void setInterceptor(final Object obj) {
@@ -175,6 +179,9 @@
         this.localContext.setAttribute(HttpContext.HTTP_REQUEST, request);
         this.localContext.setAttribute(HttpContext.HTTP_CONNECTION, conn);
         this.localContext.setAttribute(HttpContext.HTTP_TARGET_HOST, conn.getHost());
+
+        // Link own parameters as defaults 
+        request.getParams().setDefaults(this.params);
         
         if (request instanceof HttpMutableRequest) {
             preprocessRequest((HttpMutableRequest)request);
@@ -188,7 +195,7 @@
         for (int execCount = 0; ; execCount++) {
             try {
                 if (connparams.isStaleCheckingEnabled()) {
-                    if (conn.isStale()) {
+                    if (conn.isOpen() && conn.isStale()) {
                         conn.close();
                     }
                 }
@@ -220,6 +227,9 @@
                 throw ex;
             }
         }
+        
+        // Link own parameters as defaults 
+        response.getParams().setDefaults(this.params);
         
         if (response instanceof HttpMutableResponse) {
             postprocessResponse((HttpMutableResponse)response);



Mime
View raw message