Closing the connection also in case the parser is in CLOSED state.
When the request is fully read and the response is sent, the parser may enter the CLOSE state if there were Connection: close headers. It may happen that later the connection reads -1, then moves the parser is CLOSED state, so the condition to close the connection must include the CLOSED state.
This commit is contained in:
parent
fd335d6c3e
commit
bfeb7f56a6
|
@ -230,7 +230,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
|||
break;
|
||||
|
||||
// Handle close parser
|
||||
if (_parser.isClose())
|
||||
if (_parser.isClose() || _parser.isClosed())
|
||||
{
|
||||
close();
|
||||
break;
|
||||
|
@ -552,7 +552,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
|||
{
|
||||
_input.failed(x);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isNonBlocking()
|
||||
{
|
||||
|
@ -601,7 +601,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
|||
{
|
||||
return _callback.isNonBlocking();
|
||||
}
|
||||
|
||||
|
||||
private boolean reset(MetaData.Response info, boolean head, ByteBuffer content, boolean last, Callback callback)
|
||||
{
|
||||
if (reset())
|
||||
|
@ -757,7 +757,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
|||
if (_shutdownOut)
|
||||
getEndPoint().shutdownOutput();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
@ -797,7 +797,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
|||
{
|
||||
getEndPoint().fillInterested(_blockingReadCallback);
|
||||
}
|
||||
|
||||
|
||||
public void blockingReadException(Throwable e)
|
||||
{
|
||||
_blockingReadCallback.failed(e);
|
||||
|
|
Loading…
Reference in New Issue