From 0cc2199437060e3db9be02c75a912ae9d80bd398 Mon Sep 17 00:00:00 2001 From: Michael Bolz Date: Mon, 25 Jan 2016 13:29:52 +0100 Subject: [PATCH] [OLINGO-832] Fixed channel copy --- .../org/apache/olingo/server/core/ODataHttpHandlerImpl.java | 2 +- .../olingo/server/core/serializer/ChannelSerializerResult.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java index 59d79724b..9aff6a271 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java @@ -168,7 +168,7 @@ public class ODataHttpHandlerImpl implements ODataHttpHandler { while (input.read(inBuffer) > 0) { inBuffer.flip(); output.write(inBuffer); - inBuffer.rewind(); + inBuffer.clear(); } } catch (IOException e) { throw new ODataRuntimeException("Error on reading request content", e); diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java index 7768783b6..d6929860f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java @@ -71,6 +71,7 @@ public class ChannelSerializerResult implements SerializerResult { if(r <= dest.remaining()) { dest.put(buffer); } else { + r = dest.remaining(); byte[] buf = new byte[dest.remaining()]; buffer.get(buf); dest.put(buf);