Skip to content

Commit

Permalink
#8993: pass Stream.Data.EOF when possible
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Dec 2, 2022
1 parent 325eae9 commit 71e11a3
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,16 @@ public void onData(long streamId, DataFrame frame)
if (frame.isLast())
shutdownInput();

networkBuffer.retain();
StreamData data = new StreamData(frame, networkBuffer);
Stream.Data data;
if (!frame.getByteBuffer().hasRemaining() && frame.isLast())
{
data = Stream.Data.EOF;
}
else
{
networkBuffer.retain();
data = new StreamData(frame, networkBuffer);
}

Runnable existing = action.getAndSet(() ->
{
Expand Down

0 comments on commit 71e11a3

Please sign in to comment.