diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java index 28089cf16c3..b5dbe8dfae1 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java @@ -26,7 +26,6 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.client.api.Response; @@ -432,13 +431,6 @@ public abstract class HttpReceiver responseState.set(ResponseState.FAILURE); } - public void idleTimeout() - { - // If we cannot fail, it means a response arrived - // just when we were timeout idling, so we don't close - responseFailure(new TimeoutException()); - } - public boolean abort(Throwable cause) { return responseFailure(cause); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpChannelOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpChannelOverHTTP.java index ebca0792ec0..7f1e56aff14 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpChannelOverHTTP.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpChannelOverHTTP.java @@ -103,11 +103,6 @@ public class HttpChannelOverHTTP extends HttpChannel } } - public void idleTimeout() - { - receiver.idleTimeout(); - } - @Override public String toString() { diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java index 2ea9b81faeb..9c8e2458665 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java @@ -18,6 +18,8 @@ package org.eclipse.jetty.client.http; +import java.util.concurrent.TimeoutException; + import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpConnection; import org.eclipse.jetty.client.HttpDestination; @@ -93,21 +95,12 @@ public class HttpConnectionOverHTTP extends AbstractConnection implements Connec HttpExchange exchange = channel.getHttpExchange(); if (exchange != null) - idleTimeout(); - else - getHttpDestination().remove(this); + return exchange.getRequest().abort(new TimeoutException()); + getHttpDestination().remove(this); return true; } - protected void idleTimeout() - { - // TODO: we need to fail the exchange if we did not get an answer from the server - // TODO: however this mechanism does not seem to be available in SPDY if not subclassing SPDYConnection - // TODO: but the API (Session) does not have such facilities; perhaps we need to add a callback to ISession - channel.idleTimeout(); - } - @Override public void onFillable() {