[OLINGO-832] Fixed channel copy
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/0cc21994 Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/0cc21994 Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/0cc21994 Branch: refs/heads/master Commit: 0cc2199437060e3db9be02c75a912ae9d80bd398 Parents: 69f58e8 Author: Michael Bolz <[email protected]> Authored: Mon Jan 25 13:29:52 2016 +0100 Committer: Michael Bolz <[email protected]> Committed: Mon Jan 25 14:14:02 2016 +0100 ---------------------------------------------------------------------- .../java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java | 2 +- .../olingo/server/core/serializer/ChannelSerializerResult.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0cc21994/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java ---------------------------------------------------------------------- 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 59d7972..9aff6a2 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); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0cc21994/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/ChannelSerializerResult.java ---------------------------------------------------------------------- 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 7768783..d692986 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);
