Skip to content

Commit

Permalink
Bug-fix: Corrected message stream termination by the async HTTP/1.1 p…
Browse files Browse the repository at this point in the history
…rotocol handler when the connection has been half-closed by the opposite endpoint
  • Loading branch information
ok2c committed Feb 17, 2025
1 parent 660aea5 commit 841f6ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ public void requestOutput() {
@Override
public void endStream(final List<? extends Header> trailers) throws IOException {
requestState = MessageState.COMPLETE;
outputChannel.complete(trailers);
if (!keepAlive && responseState == MessageState.COMPLETE) {
outputChannel.close();
}
outputChannel.complete(trailers);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public void requestOutput() {

@Override
public void endStream(final List<? extends Header> trailers) throws IOException {
outputChannel.complete(trailers);
responseState = MessageState.COMPLETE;
outputChannel.complete(trailers);
if (requestState == MessageState.COMPLETE && !keepAlive) {
outputChannel.close();
}
Expand Down

0 comments on commit 841f6ac

Please # to comment.