From bbc2d0c29d1f84b66a2d45a16b6ea9435eea11af Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 26 Feb 2015 23:24:44 +0100 Subject: [PATCH] Simplified abort logic. --- .../org/eclipse/jetty/client/HttpSender.java | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) 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 57519ba3c1e..308f3cb941a 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 @@ -492,9 +492,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener public boolean abort(Throwable failure) { - RequestState current = requestState.get(); - boolean abortable = isBeforeCommit(current) || isSending(current); - return abortable && anyToFailure(failure); + return anyToFailure(failure); } private boolean updateRequestState(RequestState from, RequestState to) @@ -513,33 +511,6 @@ public abstract class HttpSender implements AsyncContentProvider.Listener return updated; } - private boolean isBeforeCommit(RequestState requestState) - { - switch (requestState) - { - case TRANSIENT: - case QUEUED: - case BEGIN: - case HEADERS: - return true; - default: - return false; - } - } - - private boolean isSending(RequestState requestState) - { - switch (requestState) - { - case TRANSIENT_CONTENT: - case COMMIT: - case CONTENT: - return true; - default: - return false; - } - } - private RuntimeException illegalSenderState(SenderState current) { return new IllegalStateException("Expected " + current + " found " + senderState.get() + " instead");