diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java index f6737cc0bd1..867022120bd 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java @@ -540,9 +540,13 @@ public class HttpSender implements AsyncContentProvider.Listener boolean notCommitted = isBeforeCommit(current); if (result == null && notCommitted && request.getAbortCause() == null) { - result = exchange.responseComplete(failure).getReference(); - exchange.terminateResponse(); - LOG.debug("Failed on behalf {}", exchange); + completion = exchange.responseComplete(failure); + if (completion.isMarked()) + { + result = completion.getReference(); + exchange.terminateResponse(); + LOG.debug("Failed on behalf {}", exchange); + } } if (result != null)