diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java index 925c81dab898..3a59991d93bd 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java @@ -440,11 +440,15 @@ private void postSend() { case PRE_SEND: { + // The send has not completed the callback yet, + // wait for succeeded() or failed() to be called. _state = State.POST_SEND; return; } case SUCCEED: { + // The send already completed successfully, but the + // call to succeeded() was delayed, so call it now. callback = _callback; commit = _commit; failure = null; @@ -453,6 +457,8 @@ private void postSend() } case FAIL: { + // The send already completed with a failure, but + // the call to failed() was delayed, so call it now. _state = State.FAILED; callback = _callback; commit = _commit;