Skip to content

Commit

Permalink
Issue #6642 - never shutdown output after generating a request.
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Aug 26, 2021
1 parent cb9a8d4 commit fa316fc
Showing 1 changed file with 6 additions and 9 deletions.
Expand Up @@ -346,17 +346,14 @@ private Result completing(ByteBuffer chunk, ByteBuffer content)
}
_state = State.END;

// If this is an upgrade then we don't want to close the connection.
// If this is a request, don't close the connection until the server responds.
if (_info.isRequest())
return Result.DONE;

// If successfully upgraded it is responsibility of the next protocol to close the connection.
if (_info.isResponse() && ((MetaData.Response)_info).getStatus() == HttpStatus.SWITCHING_PROTOCOLS_101)
{
return Result.DONE;
}
else if (_info.isRequest())
{
HttpField connectionHeader = _info.getFields().getField(HttpHeader.CONNECTION);
if (connectionHeader != null && connectionHeader.contains(HttpHeaderValue.UPGRADE.asString()))
return Result.DONE;
}

return Boolean.TRUE.equals(_persistent) ? Result.DONE : Result.SHUTDOWN_OUT;
}

Expand Down

0 comments on commit fa316fc

Please sign in to comment.