Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -1574,9 +1574,14 @@ public void succeeded()
{
httpChannelState._callbackFailure = failure;
if (!stream.isCommitted())
// We are not committed, so we can send an error response.
errorResponse = new ErrorResponse(request);
else
else if (httpChannelState._handling == null)
// We are committed, but no longer handling, so will complete here, ignoring any pending reads/writes
completeStream = true;
else
// We are committed and still handling, so let the HandlerInvoker complete, ignoring any pending reads/writes.
httpChannelState._streamSendState = StreamSendState.LAST_COMPLETE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not sure we should ignore pending writes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or pending reads.... it is a difficult one. I'll at least change the code to enumerate the possible states

}
}

Expand Down