You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2006/03/27 13:00:27 UTC

svn commit: r389097 - /jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/HttpBenchmark.java

Author: olegk
Date: Mon Mar 27 03:00:26 2006
New Revision: 389097

URL: http://svn.apache.org/viewcvs?rev=389097&view=rev
Log:
Changed the benchmarking tool to add the 'Connection: close' request header if the connection persistence is disabled

Modified:
    jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/HttpBenchmark.java

Modified: jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/HttpBenchmark.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/HttpBenchmark.java?rev=389097&r1=389096&r2=389097&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/HttpBenchmark.java (original)
+++ jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/HttpBenchmark.java Mon Mar 27 03:00:26 2006
@@ -37,6 +37,7 @@
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.PosixParser;
+import org.apache.http.Header;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpVersion;
@@ -52,6 +53,7 @@
 import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
+import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpRequestExecutor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
@@ -221,6 +223,9 @@
         } else {
             HttpGet httpget = new HttpGet(url.getPath());
             request = httpget;
+        }
+        if (!keepAlive) {
+            request.addHeader(new Header(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE));
         }
         
         // Prepare request executor