434810 better handling of bad messages

This commit is contained in:
Greg Wilkins 2014-05-21 22:01:28 +02:00
parent 1e524f378e
commit 3f4a8abf9e
1 changed files with 6 additions and 3 deletions

View File

@ -226,7 +226,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
filled = getEndPoint().fill(_requestBuffer); filled = getEndPoint().fill(_requestBuffer);
if (filled==0) // Do a retry on fill 0 (optimization for SSL connections) if (filled==0) // Do a retry on fill 0 (optimization for SSL connections)
filled = getEndPoint().fill(_requestBuffer); filled = getEndPoint().fill(_requestBuffer);
// tell parser // tell parser
if (filled < 0) if (filled < 0)
_parser.atEOF(); _parser.atEOF();
@ -476,9 +476,12 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
{ {
if (status<0) if (status<0)
{ {
getEndPoint().close(); EndPoint ep = getEndPoint();
while (ep.getTransport() instanceof EndPoint)
ep=(EndPoint)ep.getTransport();
ep.close();
_parser.atEOF(); _parser.atEOF();
LOG.info("Bad message close of "+getEndPoint()); LOG.debug("badMessage -1 close of {}",getEndPoint());
completed(); completed();
} }
else else