aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-08-30 10:46:32 (EDT)
committerThomas Becker2013-08-30 11:15:15 (EDT)
commit1ad4f8963876843b609414b62bf87f4957d4b57d (patch)
treea0cbd6f04c73017fda40eee8f5e4f512c5b62a9f
parentf12afb2888c2f5d78b7f26bcbd5a51f08cdbea89 (diff)
downloadorg.eclipse.jetty.project-1ad4f8963876843b609414b62bf87f4957d4b57d.zip
org.eclipse.jetty.project-1ad4f8963876843b609414b62bf87f4957d4b57d.tar.gz
org.eclipse.jetty.project-1ad4f8963876843b609414b62bf87f4957d4b57d.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 9a269fa..24378a8 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
@@ -199,8 +199,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 e0b17fe..fcbd90e 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));
}
}