Merge remote-tracking branch 'origin/jetty-9.4.x-5605-wakeup-blocked-threads' into jetty-10.0.x-5605-wakeup-blocked-threads

This commit is contained in:
Ludovic Orban 2021-02-12 16:57:27 +01:00
commit 67b533df87
2 changed files with 9 additions and 7 deletions

View File

@ -423,10 +423,12 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
LOG.warn("Pending read in onCompleted {} {}", this, getEndPoint());
abort(new IllegalStateException());
}
// Handle connection upgrades.
if (upgrade())
return;
else
{
// Handle connection upgrades.
if (upgrade())
return;
}
// Drive to EOF, EarlyEOF or Error
boolean complete = _input.consumeAll();

View File

@ -63,7 +63,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable
enum State
{
OPEN, // Open
CLOSE, // Close needed from onWriteCompletion
CLOSE, // Close needed from onWriteComplete
CLOSING, // Close in progress after close API called
CLOSED // Closed
}
@ -294,7 +294,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable
{
// Somebody called close or complete while we were writing.
// We can now send a (probably empty) last buffer and then when it completes
// onWriteCompletion will be called again to actually execute the _completeCallback
// onWriteComplete will be called again to actually execute the _completeCallback
_state = State.CLOSING;
closeContent = BufferUtil.hasContent(_aggregate) ? _aggregate : BufferUtil.EMPTY_BUFFER;
}
@ -421,8 +421,8 @@ public class HttpOutput extends ServletOutputStream implements Runnable
// If we can't complete due to the API state, then abort
if (error != null)
{
_writeBlocker.fail(error);
_channel.abort(error);
_writeBlocker.fail(error);
_state = State.CLOSED;
}
else