geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r597076 - /geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java
Date Wed, 21 Nov 2007 13:31:10 GMT
Author: jgenender
Date: Wed Nov 21 05:31:09 2007
New Revision: 597076

URL: http://svn.apache.org/viewvc?rev=597076&view=rev
Log:
GERONIMO-3613 - Fix the timeout configuration

Modified:
    geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java

Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java?rev=597076&r1=597075&r2=597076&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java (original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/AsyncHttpClient.java Wed
Nov 21 05:31:09 2007
@@ -111,7 +111,7 @@
         else
             connector = new SocketConnector(Runtime.getRuntime().availableProcessors(), threadPool);
 
-        connector.getDefaultConfig().setConnectTimeout(this.connectionTimeout / 1000);
+        applyConnectionTimeout();
         connector.setWorkerTimeout(1);
 
     }
@@ -148,6 +148,12 @@
      */
     public void setConnectionTimeout(int connectionTimeout) {
         this.connectionTimeout = connectionTimeout;
+        // apply the new connect timeout value to the config
+        applyConnectionTimeout();
+    }
+
+    private void applyConnectionTimeout() {
+        connector.getDefaultConfig().setConnectTimeout(connectionTimeout/1000);
     }
 
     /**



Mime
View raw message