Skip to content

Commit

Permalink
Always call onInboundComplete in case of HTTP/1.1 and TLS upgrade flow
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta committed Dec 16, 2024
1 parent d33486c commit b3060a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -814,12 +814,6 @@ else if (msg instanceof HttpRequest) {
}
else {
request.release();
// HTTP/1.1 TLS Upgrade (RFC-2817) on empty requests (GET/HEAD/OPTIONS)
if (!isHttp2() && request.headers().contains(HttpHeaderNames.UPGRADE)) {
//force auto read to enable more accurate close selection now inbound is done
channel().config().setAutoRead(true);
onInboundComplete();
}
}
if (isHttp2()) {
//force auto read to enable more accurate close selection now inbound is done
Expand All @@ -828,9 +822,10 @@ else if (msg instanceof HttpRequest) {
}
else if (!isHttp2() && request.headers().contains(HttpHeaderNames.UPGRADE)) {
// HTTP/1.1 TLS Upgrade (RFC-2817) requests (GET/HEAD/OPTIONS) with empty / non-empty payload
// No need to call onInboundComplete(), it will be triggered by onInboundNext(...)
// since this is the last HTTP content
stopReadTimeout();
//force auto read to enable more accurate close selection now inbound is done
channel().config().setAutoRead(true);
onInboundComplete();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3641,6 +3641,5 @@ public void accept(HttpContent message) {
public void subscribe(Subscriber<? super HttpContent> s) {
sender.subscribe(s);
}

}
}

0 comments on commit b3060a3

Please sign in to comment.