From bfeb7f56a60d5efc4b9b7a2be39c0b75f1991a03 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 20 Aug 2015 18:23:55 +0200 Subject: [PATCH] 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. --- .../java/org/eclipse/jetty/server/HttpConnection.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index c904d0ab6f8..4f3a84b1474 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -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);