Issue #5605 - java.io.IOException: unconsumed input during http request parsing.

Fixed detection of EOF in failAllContent().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2020-11-19 15:21:44 +01:00
parent 3a44648e46
commit cb10c35daf
1 changed files with 11 additions and 3 deletions

View File

@ -130,8 +130,10 @@ public class HttpChannelOverHttp extends HttpChannel implements HttpParser.Reque
{
if (LOG.isDebugEnabled())
LOG.debug("failing all content with {}", (Object)failure);
if (_content != null && !_content.isSpecial())
if (_content != null)
{
if (_content.isSpecial())
return _content.isEof();
_content.failed(failure);
_content = _content.isEof() ? EOF : null;
if (_content == EOF)
@ -146,15 +148,21 @@ public class HttpChannelOverHttp extends HttpChannel implements HttpParser.Reque
LOG.debug("failed all content, EOF was not reached");
return false;
}
c.skip(c.remaining());
c.failed(failure);
if (c.isSpecial())
{
_content = c;
boolean atEof = c.isEof();
if (LOG.isDebugEnabled())
LOG.debug("failed all content, EOF = {}", atEof);
return atEof;
}
c.skip(c.remaining());
c.failed(failure);
if (c.isEof())
{
_content = EOF;
return true;
}
}
}