hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1605336 - in /httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark: BenchmarkWorker.java HttpBenchmark.java
Date Wed, 25 Jun 2014 11:15:20 GMT
Author: olegk
Date: Wed Jun 25 11:15:19 2014
New Revision: 1605336

URL: http://svn.apache.org/r1605336
Log:
Fixed problem with HttpBenchmark ignoring #isUseExpectContinue and #isUseHttp1_0 config parameters

Modified:
    httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
    httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java

Modified: httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java?rev=1605336&r1=1605335&r2=1605336&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
Wed Jun 25 11:15:19 2014
@@ -90,7 +90,7 @@ class BenchmarkWorker implements Runnabl
                 new RequestTargetHost(),
                 new RequestConnControl(),
                 new RequestUserAgent("HttpCore-AB/1.1"),
-                new RequestExpectContinue(true));
+                new RequestExpectContinue(this.config.isUseExpectContinue()));
         this.httpexecutor = new HttpRequestExecutor();
 
         this.connstrategy = DefaultConnectionReuseStrategy.INSTANCE;

Modified: httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java?rev=1605336&r1=1605335&r2=1605336&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java
Wed Jun 25 11:15:19 2014
@@ -51,6 +51,7 @@ import org.apache.http.Header;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpVersion;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.FileEntity;
 import org.apache.http.entity.StringEntity;
@@ -112,15 +113,16 @@ public class HttpBenchmark {
             se.setChunked(config.isUseChunking());
             entity = se;
         }
+        final HttpVersion ver = config.isUseHttp1_0() ? HttpVersion.HTTP_1_0 : HttpVersion.HTTP_1_1;
         final HttpRequest request;
         if ("POST".equals(config.getMethod())) {
             final BasicHttpEntityEnclosingRequest httppost =
-                    new BasicHttpEntityEnclosingRequest("POST", url.getPath());
+                    new BasicHttpEntityEnclosingRequest("POST", url.getPath(), ver);
             httppost.setEntity(entity);
             request = httppost;
         } else if ("PUT".equals(config.getMethod())) {
             final BasicHttpEntityEnclosingRequest httpput =
-                    new BasicHttpEntityEnclosingRequest("PUT", url.getPath());
+                    new BasicHttpEntityEnclosingRequest("PUT", url.getPath(), ver);
             httpput.setEntity(entity);
             request = httpput;
         } else {
@@ -130,7 +132,7 @@ public class HttpBenchmark {
             } else if (path.trim().length() == 0) {
                 path = "/";
             }
-            request = new BasicHttpRequest(config.getMethod(), path);
+            request = new BasicHttpRequest(config.getMethod(), path, ver);
         }
 
         if (!config.isKeepAlive()) {



Mime
View raw message