Skip to content

Commit

Permalink
[UNDERTOW-2251] At Http2DataStreamSinkChannel, dot not send END_STREA…
Browse files Browse the repository at this point in the history
…M in the response if response status is 100

Signed-off-by: Flavia Rainone <frainone@redhat.com>
  • Loading branch information
fl4via committed Apr 12, 2023
1 parent affd5f2 commit a991a9a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected SendFrameHeader createFrameHeaderImpl() {
firstBuffer.put(0, (byte) ((headerFrameLength >> 16) & 0xFF));
firstBuffer.put(1, (byte) ((headerFrameLength >> 8) & 0xFF));
firstBuffer.put(2, (byte) (headerFrameLength & 0xFF));
firstBuffer.put(4, (byte) ((isFinalFrameQueued() && !getBuffer().hasRemaining() && frameType == Http2Channel.FRAME_TYPE_HEADERS && trailers == null ? Http2Channel.HEADERS_FLAG_END_STREAM : 0) | (result == HpackEncoder.State.COMPLETE ? Http2Channel.HEADERS_FLAG_END_HEADERS : 0 ) | (paddingBytes > 0 ? Http2Channel.HEADERS_FLAG_PADDED : 0))); //flags
firstBuffer.put(4, (byte) ((isFinalFrameQueued() && !getBuffer().hasRemaining() && frameType == Http2Channel.FRAME_TYPE_HEADERS && !isContinueStatus() && trailers == null ? Http2Channel.HEADERS_FLAG_END_STREAM : 0) | (result == HpackEncoder.State.COMPLETE ? Http2Channel.HEADERS_FLAG_END_HEADERS : 0 ) | (paddingBytes > 0 ? Http2Channel.HEADERS_FLAG_PADDED : 0))); //flags
ByteBuffer currentBuffer = firstBuffer;

if(currentBuffer.remaining() < paddingBytes) {
Expand Down Expand Up @@ -265,6 +265,10 @@ protected SendFrameHeader createFrameHeaderImpl() {

}

private boolean isContinueStatus() {
return "100".equals(this.getHeaders().getFirst(Http2Channel.STATUS));
}

private HpackEncoder.State encodeContinuationFrame(HeaderMap headers, PooledByteBuffer current) {
ByteBuffer currentBuffer;
HpackEncoder.State result;//continuation frame
Expand Down

0 comments on commit a991a9a

Please sign in to comment.