Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A62C110666 for ; Wed, 3 Jul 2013 19:12:04 +0000 (UTC) Received: (qmail 94875 invoked by uid 500); 3 Jul 2013 19:12:04 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 94848 invoked by uid 500); 3 Jul 2013 19:12:04 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 94841 invoked by uid 99); 3 Jul 2013 19:12:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 19:12:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 19:12:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 05C792388900 for ; Wed, 3 Jul 2013 19:11:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130703191141.05C792388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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(); }