#6491 add defensive check

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2021-07-22 11:51:49 +02:00
parent cd20770548
commit 54763edf33
1 changed files with 5 additions and 0 deletions

View File

@ -316,6 +316,11 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
*/
protected boolean fillAndParseForContent()
{
// Defensive check to avoid an infinite select/wakeup/fillAndParseForContent/wait loop
// in case the parser was mistakenly closed and the connection was not aborted.
if (_parser.isClose() || _parser.isClosed())
throw new IllegalStateException("Parser is closed: " + _parser);
boolean handled = false;
while (_parser.inContentState())
{