hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1482760 - /httpcomponents/benchmark/httpclient/trunk/src/main/java/org/apache/http/client/benchmark/Benchmark.java
Date Wed, 15 May 2013 11:09:17 GMT
Author: olegk
Date: Wed May 15 11:09:16 2013
New Revision: 1482760

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

Modified:
    httpcomponents/benchmark/httpclient/trunk/src/main/java/org/apache/http/client/benchmark/Benchmark.java

Modified: httpcomponents/benchmark/httpclient/trunk/src/main/java/org/apache/http/client/benchmark/Benchmark.java
URL: http://svn.apache.org/viewvc/httpcomponents/benchmark/httpclient/trunk/src/main/java/org/apache/http/client/benchmark/Benchmark.java?rev=1482760&r1=1482759&r2=1482760&view=diff
==============================================================================
--- httpcomponents/benchmark/httpclient/trunk/src/main/java/org/apache/http/client/benchmark/Benchmark.java
(original)
+++ httpcomponents/benchmark/httpclient/trunk/src/main/java/org/apache/http/client/benchmark/Benchmark.java
Wed May 15 11:09:16 2013
@@ -178,12 +178,13 @@ public class Benchmark {
                 buffer.flush();
             }
             final byte[] content = buffer.getBuf();
+            final int len = buffer.getCount();
 
             response.setStatus(200);
-            response.setContentLength(content.length);
+            response.setContentLength(len);
 
             final OutputStream outstream = response.getOutputStream();
-            outstream.write(content);
+            outstream.write(content, 0, len);
             outstream.flush();
         }
 



Mime
View raw message