From 424bffca74491fca841b6fca268f81b629248c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= Date: Tue, 25 Mar 2014 17:45:32 +0100 Subject: [PATCH] Temp. disable use of new PagedBytesReference since it breaks HTTP replies with 0-sized Content-Length --- .../org/elasticsearch/common/io/stream/BytesStreamOutput.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/common/io/stream/BytesStreamOutput.java b/src/main/java/org/elasticsearch/common/io/stream/BytesStreamOutput.java index 899ecf2d873..172b07ff04a 100644 --- a/src/main/java/org/elasticsearch/common/io/stream/BytesStreamOutput.java +++ b/src/main/java/org/elasticsearch/common/io/stream/BytesStreamOutput.java @@ -153,7 +153,9 @@ public class BytesStreamOutput extends StreamOutput implements BytesStream { @Override public BytesReference bytes() { - return new PagedBytesReference(bigarrays, bytes, count); + BytesRef bref = new BytesRef(); + bytes.get(0, count, bref); + return new BytesArray(bref, false); } private void ensureCapacity(int offset) {