hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [23/34] httpcomponents-core git commit: Fixed problem with HttpBenchmark ignoring #isUseExpectContinue and #isUseHttp1_0 config parameters
Date Tue, 09 May 2017 20:02:52 GMT
Fixed problem with HttpBenchmark ignoring #isUseExpectContinue and #isUseHttp1_0 config parameters

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.3.x@1605334
13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/3ccf1e10
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/3ccf1e10
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/3ccf1e10

Branch: refs/heads/4.3.x
Commit: 3ccf1e1037b6863a12a8c9cd34554e462df0ea14
Parents: 99653c7
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Wed Jun 25 11:13:15 2014 +0000
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Wed Jun 25 11:13:15 2014 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/http/benchmark/BenchmarkWorker.java | 2 +-
 .../main/java/org/apache/http/benchmark/HttpBenchmark.java   | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3ccf1e10/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
----------------------------------------------------------------------
diff --git a/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java b/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
index 2bee2b5..7ba8a4f 100644
--- a/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
+++ b/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
@@ -90,7 +90,7 @@ class BenchmarkWorker implements Runnable {
                 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;

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/3ccf1e10/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java
----------------------------------------------------------------------
diff --git a/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java b/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java
index b4e1295..a771368 100644
--- a/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java
+++ b/httpcore-ab/src/main/java/org/apache/http/benchmark/HttpBenchmark.java
@@ -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