Issue #6642 - never shutdown output after generating a request.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
cb9a8d4060
commit
fa316fc20d
|
@ -346,17 +346,14 @@ public class HttpGenerator
|
|||
}
|
||||
_state = State.END;
|
||||
|
||||
// If this is an upgrade then we don't want to close the connection.
|
||||
if (_info.isResponse() && ((MetaData.Response)_info).getStatus() == HttpStatus.SWITCHING_PROTOCOLS_101)
|
||||
{
|
||||
// If this is a request, don't close the connection until the server responds.
|
||||
if (_info.isRequest())
|
||||
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;
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
return Boolean.TRUE.equals(_persistent) ? Result.DONE : Result.SHUTDOWN_OUT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue