aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-07-23 04:51:56 (EDT)
committerThomas Becker2013-07-23 04:52:13 (EDT)
commit4837b75eeca16170d7eeaab30dcf0dedecfae05b (patch)
tree001747860d248b3eb15b32e56f2e37be7bc125da
parentf19421112a90d993514ae20b09a6a95f18d57a2a (diff)
downloadorg.eclipse.jetty.project-4837b75eeca16170d7eeaab30dcf0dedecfae05b.zip
org.eclipse.jetty.project-4837b75eeca16170d7eeaab30dcf0dedecfae05b.tar.gz
org.eclipse.jetty.project-4837b75eeca16170d7eeaab30dcf0dedecfae05b.tar.bz2
413155 HttpTransportOverSPDY remove constructor argument for version and get version from stream.getSession instead
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HTTPSPDYServerConnectionFactory.java2
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java8
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java8
3 files changed, 10 insertions, 8 deletions
diff --git a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HTTPSPDYServerConnectionFactory.java b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HTTPSPDYServerConnectionFactory.java
index 776ccaf..45d867a 100644
--- a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HTTPSPDYServerConnectionFactory.java
+++ b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HTTPSPDYServerConnectionFactory.java
@@ -106,7 +106,7 @@ public class HTTPSPDYServerConnectionFactory extends SPDYServerConnectionFactory
("gzip")))
headers.add("accept-encoding", "gzip");
HttpTransportOverSPDY transport = new HttpTransportOverSPDY(connector, httpConfiguration, endPoint,
- pushStrategy, stream, headers, getVersion());
+ pushStrategy, stream, headers);
HttpInputOverSPDY input = new HttpInputOverSPDY();
HttpChannelOverSPDY channel = new HttpChannelOverSPDY(connector, httpConfiguration, endPoint, transport, input, stream);
stream.setAttribute(CHANNEL_ATTRIBUTE, channel);
diff --git a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
index fd72667..3ecc8b6 100644
--- a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
+++ b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
@@ -43,6 +43,7 @@ import org.eclipse.jetty.spdy.api.HeadersInfo;
import org.eclipse.jetty.spdy.api.PushInfo;
import org.eclipse.jetty.spdy.api.ReplyInfo;
import org.eclipse.jetty.spdy.api.SPDY;
+import org.eclipse.jetty.spdy.api.Session;
import org.eclipse.jetty.spdy.api.Stream;
import org.eclipse.jetty.spdy.api.StreamStatus;
import org.eclipse.jetty.util.BlockingCallback;
@@ -68,7 +69,7 @@ public class HttpTransportOverSPDY implements HttpTransport
private final BlockingCallback streamBlocker = new BlockingCallback();
private final AtomicBoolean committed = new AtomicBoolean();
- public HttpTransportOverSPDY(Connector connector, HttpConfiguration configuration, EndPoint endPoint, PushStrategy pushStrategy, Stream stream, Fields requestHeaders, short version)
+ public HttpTransportOverSPDY(Connector connector, HttpConfiguration configuration, EndPoint endPoint, PushStrategy pushStrategy, Stream stream, Fields requestHeaders)
{
this.connector = connector;
this.configuration = configuration;
@@ -76,7 +77,8 @@ public class HttpTransportOverSPDY implements HttpTransport
this.pushStrategy = pushStrategy == null ? new PushStrategy.None() : pushStrategy;
this.stream = stream;
this.requestHeaders = requestHeaders;
- this.version = version;
+ Session session = stream.getSession();
+ this.version = session.getVersion();
}
protected Stream getStream()
@@ -254,7 +256,7 @@ public class HttpTransportOverSPDY implements HttpTransport
PushStrategy pushStrategy, Stream stream, Fields requestHeaders,
PushResourceCoordinator coordinator, short version)
{
- super(connector, configuration, endPoint, pushStrategy, stream, requestHeaders, version);
+ super(connector, configuration, endPoint, pushStrategy, stream, requestHeaders);
this.coordinator = coordinator;
this.version = version;
}
diff --git a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java
index b7ac880..9689a2d 100644
--- a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java
+++ b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java
@@ -72,22 +72,22 @@ public class HttpTransportOverSPDYTest
@Mock
HttpGenerator.ResponseInfo responseInfo;
- private Random random = new Random();
+ Random random = new Random();
+ short version = SPDY.V3;
HttpTransportOverSPDY httpTransportOverSPDY;
- private short version = SPDY.V3;
@Before
public void setUp() throws Exception
{
Fields requestHeaders = new Fields();
requestHeaders.add(HTTPSPDYHeader.METHOD.name(version), "GET");
- httpTransportOverSPDY = new HttpTransportOverSPDY(connector, httpConfiguration, endPoint, pushStrategy,
- stream, requestHeaders, version);
when(responseInfo.getStatus()).thenReturn(HttpStatus.OK_200);
when(stream.getSession()).thenReturn(session);
when(session.getVersion()).thenReturn(SPDY.V3);
when(stream.isClosed()).thenReturn(false);
+ httpTransportOverSPDY = new HttpTransportOverSPDY(connector, httpConfiguration, endPoint, pushStrategy,
+ stream, requestHeaders);
}
@Test