Skip to content

Commit

Permalink
more digging
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Aug 28, 2024
1 parent 60ac0ce commit 14bded8
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ private void externalAbort(Throwable failure, Promise<Boolean> promise)
if (abort)
{
contentSender.abort = promise;
contentSender.abort(this.failure.get());
contentSender.abort(this.failure.get()); // this is going to call internalAbort()
}
else
{
Expand All @@ -388,8 +388,14 @@ private void externalAbort(Throwable failure, Promise<Boolean> promise)

private void internalAbort(HttpExchange exchange, Throwable failure)
{
if (anyToFailure(failure))
// internalAbort() may be called from externalAbort() (which already called anyToFailure)
// so we cannot rely on its return code to figure out if abortRequest() should be called or not.
anyToFailure(failure);
// internalAbort() may be called after ContentSender.reset() so exchange might be null.
if (exchange != null)
abortRequest(exchange);
else
dispose();
}

private boolean updateRequestState(RequestState from, RequestState to)
Expand Down

0 comments on commit 14bded8

Please sign in to comment.