#9524 do not create AsynchronousCloseException unnecessarily

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2023-05-30 09:28:12 +02:00
parent 6567a4478e
commit e4f4828a0e
1 changed files with 5 additions and 2 deletions

View File

@ -359,8 +359,11 @@ public class InputStreamResponseListener extends Listener.Adapter
if (LOG.isDebugEnabled())
LOG.debug("InputStream close");
Throwable failure = new AsynchronousCloseException();
callbacks.forEach(callback -> callback.failed(failure));
if (!callbacks.isEmpty())
{
Throwable failure = new AsynchronousCloseException();
callbacks.forEach(callback -> callback.failed(failure));
}
super.close();
}