Fix #5605 Unblock non container Threads
Don't consumeAll before upgrade
This commit is contained in:
parent
a110fc3468
commit
a100d80d26
|
@ -376,17 +376,15 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
||||||
@Override
|
@Override
|
||||||
public void onCompleted()
|
public void onCompleted()
|
||||||
{
|
{
|
||||||
boolean complete = _input.consumeAll();
|
|
||||||
Throwable cancelled = getEndPoint().cancelFillInterest(_input::getError);
|
|
||||||
if (LOG.isDebugEnabled())
|
|
||||||
LOG.debug("cancelled {}", this, cancelled);
|
|
||||||
|
|
||||||
// Handle connection upgrades
|
// Handle connection upgrades
|
||||||
if (_channel.getResponse().getStatus() == HttpStatus.SWITCHING_PROTOCOLS_101)
|
if (_channel.getResponse().getStatus() == HttpStatus.SWITCHING_PROTOCOLS_101)
|
||||||
{
|
{
|
||||||
Connection connection = (Connection)_channel.getRequest().getAttribute(UPGRADE_CONNECTION_ATTRIBUTE);
|
Connection connection = (Connection)_channel.getRequest().getAttribute(UPGRADE_CONNECTION_ATTRIBUTE);
|
||||||
if (connection != null)
|
if (connection != null)
|
||||||
{
|
{
|
||||||
|
Throwable cancelled = getEndPoint().cancelFillInterest(_input::getError);
|
||||||
|
if (LOG.isDebugEnabled())
|
||||||
|
LOG.debug("cancelled {}", this, cancelled);
|
||||||
if (LOG.isDebugEnabled())
|
if (LOG.isDebugEnabled())
|
||||||
LOG.debug("Upgrade from {} to {}", this, connection);
|
LOG.debug("Upgrade from {} to {}", this, connection);
|
||||||
_channel.getState().upgrade();
|
_channel.getState().upgrade();
|
||||||
|
@ -406,6 +404,11 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean complete = _input.consumeAll();
|
||||||
|
Throwable cancelled = getEndPoint().cancelFillInterest(_input::getError);
|
||||||
|
if (LOG.isDebugEnabled())
|
||||||
|
LOG.debug("cancelled {}", this, cancelled);
|
||||||
|
|
||||||
// Finish consuming the request
|
// Finish consuming the request
|
||||||
// If we are still expecting
|
// If we are still expecting
|
||||||
if (_channel.isExpecting100Continue())
|
if (_channel.isExpecting100Continue())
|
||||||
|
|
Loading…
Reference in New Issue