From cf09f69e53156f6bc2b5fdb81996933a38764b94 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 30 Mar 2011 15:50:13 +0000 Subject: [PATCH] Fixed #341386 (Remote close not detected by HttpClient). git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2938 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../eclipse/jetty/client/HttpConnection.java | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 02e585d1b1b..43b370c2139 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -18,6 +18,7 @@ jetty-7.3.2-SNAPSHOT + 341206 Stop order is wrong in HandlerWrapper + 341255 org.eclipse.http usage in AJP/SessionId linkage + Added extra session removal test + + 341386 Remote close not detected by HttpClient jetty-7.3.1.v20110307 7 March 2011 + 316382 Support a more strict SSL option with certificates diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java index 7046e7f82e3..d8d57b3eaa5 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java @@ -175,14 +175,21 @@ public class HttpConnection /* extends AbstractConnection */ implements Connecti } else { - // Hopefully just space? - _parser.fill(); - _parser.skipCRLF(); - if (_parser.isMoreInBuffer()) + long filled = _parser.fill(); + if (filled < 0) { - Log.warn("Unexpected data received but no request sent"); close(); } + else + { + // Hopefully just space? + _parser.skipCRLF(); + if (_parser.isMoreInBuffer()) + { + Log.warn("Unexpected data received but no request sent"); + close(); + } + } return this; } }