aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-08-30 10:46:32 (EDT)
committerThomas Becker2013-08-30 11:22:05 (EDT)
commit85c0f4733728de8bf653ad297a903f2202d03f18 (patch)
tree08da9cc646849ad75f10b0f862d6c3f71911247c
parent669ee7572006943e779daeeb6c91f930441ebae4 (diff)
downloadorg.eclipse.jetty.project-85c0f4733728de8bf653ad297a903f2202d03f18.zip
org.eclipse.jetty.project-85c0f4733728de8bf653ad297a903f2202d03f18.tar.gz
org.eclipse.jetty.project-85c0f4733728de8bf653ad297a903f2202d03f18.tar.bz2
416251 ProxyHTTPToSPDYConnection now sends a 502 to the client if it receives a rst frame from the upstream spdy server
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java5
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPToSPDYTest.java4
2 files changed, 6 insertions, 3 deletions
diff --git a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java
index f2e1218..0027c83 100644
--- a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java
+++ b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java
@@ -200,8 +200,9 @@ public class ProxyHTTPSPDYConnection extends HttpConnection implements HttpParse
@Override
public void rst(RstInfo rstInfo, Callback handler)
{
- // Not much we can do in HTTP land: just close the connection
- goAway(new GoAwayInfo(rstInfo.getTimeout(), rstInfo.getUnit()), handler);
+ HttpGenerator.ResponseInfo info = new HttpGenerator.ResponseInfo(HttpVersion.fromString(headers.get
+ ("version").value()), null, 0, 502, "SPDY reset received from upstream server", false);
+ send(info, null, true, new Callback.Adapter());
}
@Override
diff --git a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPToSPDYTest.java b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPToSPDYTest.java
index 5368ba7..cb8f6a3 100644
--- a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPToSPDYTest.java
+++ b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPToSPDYTest.java
@@ -144,6 +144,8 @@ public class ProxyHTTPToSPDYTest
@After
public void destroy() throws Exception
{
+ httpClient.stop();
+ httpClient2.stop();
if (server != null)
{
server.stop();
@@ -417,6 +419,6 @@ public class ProxyHTTPToSPDYTest
}));
ContentResponse response = httpClient.newRequest("localhost", proxyAddress.getPort()).method(HttpMethod.GET).send();
- assertThat("response code is 500 OK", response.getStatus(), is(500));
+ assertThat("response code is 502 Gateway Error", response.getStatus(), is(502));
}
}