Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2013-07-08 13:23:40 +0000
committerGreg Wilkins2013-07-08 13:23:40 +0000
commit809c3aa472f39f7003c588e3b3aa11ca688f58e9 (patch)
treeaa361fc5664f23d4f8fba3facf43df2a15c24997 /jetty-http
parent2d3f0bfe0b9b949cb8726e71750910bf48eb7472 (diff)
downloadorg.eclipse.jetty.project-809c3aa472f39f7003c588e3b3aa11ca688f58e9.tar.gz
org.eclipse.jetty.project-809c3aa472f39f7003c588e3b3aa11ca688f58e9.tar.xz
org.eclipse.jetty.project-809c3aa472f39f7003c588e3b3aa11ca688f58e9.zip
412442 Avoid connection timeout after FIN-FIN close
Diffstat (limited to 'jetty-http')
-rw-r--r--jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java
index b0e7909da0..de08e656c8 100644
--- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java
+++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java
@@ -96,6 +96,7 @@ public class HttpParser
CLOSED
};
+ private final boolean DEBUG=LOG.isDebugEnabled();
private final HttpHandler<ByteBuffer> _handler;
private final RequestHandler<ByteBuffer> _requestHandler;
private final ResponseHandler<ByteBuffer> _responseHandler;
@@ -741,7 +742,8 @@ public class HttpParser
}
catch (NumberFormatException e)
{
- LOG.debug(e);
+ if (DEBUG)
+ LOG.debug(e);
throw new BadMessage(HttpStatus.BAD_REQUEST_400,"Bad Host header");
}
break loop;
@@ -1369,7 +1371,8 @@ public class HttpParser
BufferUtil.clear(buffer);
LOG.warn("badMessage: "+e._code+(e._message!=null?" "+e._message:"")+" for "+_handler);
- LOG.debug(e);
+ if (DEBUG)
+ LOG.debug(e);
setState(State.CLOSED);
_handler.badMessage(e._code, e._message);
return false;
@@ -1379,7 +1382,8 @@ public class HttpParser
BufferUtil.clear(buffer);
LOG.warn("badMessage: "+e.toString()+" for "+_handler);
- LOG.debug(e);
+ if (DEBUG)
+ LOG.debug(e);
if (_state.ordinal()<=State.END.ordinal())
{
@@ -1408,7 +1412,8 @@ public class HttpParser
*/
public boolean shutdownInput()
{
- LOG.debug("shutdownInput {}", this);
+ if (DEBUG)
+ LOG.debug("shutdownInput {}", this);
// was this unexpected?
switch(_state)
@@ -1437,6 +1442,8 @@ public class HttpParser
/* ------------------------------------------------------------------------------- */
public void close()
{
+ if (DEBUG)
+ LOG.debug("close {}", this);
switch(_state)
{
case START:
@@ -1469,6 +1476,8 @@ public class HttpParser
/* ------------------------------------------------------------------------------- */
public void reset()
{
+ if (DEBUG)
+ LOG.debug("reset {}", this);
// reset state
setState(State.START);
_endOfContent=EndOfContent.UNKNOWN_CONTENT;
@@ -1483,7 +1492,8 @@ public class HttpParser
/* ------------------------------------------------------------------------------- */
private void setState(State state)
{
- // LOG.debug("{} --> {}",_state,state);
+ if (DEBUG)
+ LOG.debug("{} --> {}",_state,state);
_state=state;
}

Back to the top