Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2021-02-09 17:02:54 +01:00
parent f81ff1707e
commit a29a054fe1
1 changed files with 4 additions and 1 deletions

View File

@ -319,7 +319,10 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
while (_parser.inContentState())
{
boolean handled = parseRequestBuffer();
if (handled || filled <= 0)
// Re-check the parser state after parsing to avoid filling,
// otherwise fillRequestBuffer() would acquire a ByteBuffer
// that may be leaked.
if (handled || filled <= 0 || !_parser.inContentState())
break;
filled = fillRequestBuffer();
}