hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1499522 - /httpcomponents/benchmark/httpclient/branches/4.2.x/src/main/java/org/apache/http/client/benchmark/Benchmark.java
Date Wed, 03 Jul 2013 19:11:40 GMT
Author: olegk
Date: Wed Jul  3 19:11:40 2013
New Revision: 1499522

URL: http://svn.apache.org/r1499522
Log:
Fixed content length bug in Echo handler

Modified:
    httpcomponents/benchmark/httpclient/branches/4.2.x/src/main/java/org/apache/http/client/benchmark/Benchmark.java

Modified: httpcomponents/benchmark/httpclient/branches/4.2.x/src/main/java/org/apache/http/client/benchmark/Benchmark.java
URL: http://svn.apache.org/viewvc/httpcomponents/benchmark/httpclient/branches/4.2.x/src/main/java/org/apache/http/client/benchmark/Benchmark.java?rev=1499522&r1=1499521&r2=1499522&view=diff
==============================================================================
--- httpcomponents/benchmark/httpclient/branches/4.2.x/src/main/java/org/apache/http/client/benchmark/Benchmark.java
(original)
+++ httpcomponents/benchmark/httpclient/branches/4.2.x/src/main/java/org/apache/http/client/benchmark/Benchmark.java
Wed Jul  3 19:11:40 2013
@@ -185,12 +185,13 @@ public class Benchmark {
                 buffer.flush();
             }
             byte[] content = buffer.getBuf();
+            int len = buffer.getCount();
 
             response.setStatus(200);
-            response.setContentLength(content.length);
+            response.setContentLength(len);
 
             OutputStream outstream = response.getOutputStream();
-            outstream.write(content);
+            outstream.write(content, 0, len);
             outstream.flush();
         }
 



Mime
View raw message