Skip to content

Commit

Permalink
Update the pointer of Continuation's headerBuffer after copying the p…
Browse files Browse the repository at this point in the history
…ayload.
  • Loading branch information
CoolTomatos committed Nov 26, 2024
1 parent 306de8e commit cf825f1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1342,8 +1342,11 @@ void copyPayload(final ByteBuffer payload) {
if (payload == null) {
return;
}
headerBuffer.ensureCapacity(payload.remaining());
payload.get(headerBuffer.array(), headerBuffer.length(), payload.remaining());
int originalLength = headerBuffer.length();
int toCopy = payload.remaining();
headerBuffer.ensureCapacity(toCopy);
payload.get(headerBuffer.array(), originalLength, toCopy);
headerBuffer.setLength(originalLength + toCopy);
}

ByteBuffer getContent() {
Expand Down

0 comments on commit cf825f1

Please sign in to comment.