Permalink
Browse files

Very early changes for SPDY/3 support with the Grizzly provider. More…

… changes pending.
  • Loading branch information...
1 parent 63d6cac commit 1379ba5bdec90ed3d71f3f7233325418d5943246 @rlubke rlubke committed May 8, 2013
@@ -110,6 +110,7 @@
protected boolean strict302Handling;
protected int maxConnectionLifeTimeInMs;
protected boolean useRelativeURIsWithSSLProxies;
+ protected boolean spdyEnabled;
protected AsyncHttpClientConfig() {
}
@@ -145,7 +146,8 @@ private AsyncHttpClientConfig(int maxTotalConnections,
HostnameVerifier hostnameVerifier,
int ioThreadMultiplier,
boolean strict302Handling,
- boolean useRelativeURIsWithSSLProxies) {
+ boolean useRelativeURIsWithSSLProxies,
+ boolean spdyEnabled) {
this.maxTotalConnections = maxTotalConnections;
this.maxConnectionPerHost = maxConnectionPerHost;
@@ -185,6 +187,7 @@ private AsyncHttpClientConfig(int maxTotalConnections,
}
this.proxyServer = proxyServer;
this.useRawUrl = useRawUrl;
+ this.spdyEnabled = spdyEnabled;
}
/**
@@ -456,6 +459,13 @@ public boolean isUseRawUrl() {
}
/**
+ * @return whether or not SPDY is enabled.
+ */
+ public boolean isSpdyEnabled() {
+ return spdyEnabled;
+ }
+
+ /**
* Return true if the query parameters will be stripped from the request when a redirect is requested.
*
* @return true if the query parameters will be stripped from the request when a redirect is requested.
@@ -575,6 +585,7 @@ public Thread newThread(Runnable r) {
private HostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier();
private int ioThreadMultiplier = 2;
private boolean strict302Handling;
+ private boolean spdyEnabled;
public Builder() {
}
@@ -1032,6 +1043,21 @@ public Builder setUseRelativeURIsWithSSLProxies(boolean useRelativeURIsWithSSLPr
}
/**
+ * Enables SPDY support. Note that doing so, will currently disable WebSocket support
+ * for this client instance. If not explicitly enabled, spdy will not be used.
+ *
+ * @param spdyEnabled configures spdy support.
+ *
+ * @return this
+ *
+ * @since 2.0
+ */
+ public Builder setSpdyEnabled(boolean spdyEnabled) {
+ this.spdyEnabled = spdyEnabled;
+ return this;
+ }
+
+ /**
* Create a config builder with values taken from the given prototype configuration.
*
* @param prototype the configuration to use as a prototype.
@@ -1124,7 +1150,8 @@ public AsyncHttpClientConfig build() {
hostnameVerifier,
ioThreadMultiplier,
strict302Handling,
- useRelativeURIsWithSSLProxies);
+ useRelativeURIsWithSSLProxies,
+ spdyEnabled);
}
}
}
View
@@ -13,18 +13,26 @@
The Async Http Client Grizzly Provider.
</description>
+ <properties>
+ <grizzly.version>2.3.3-SNAPSHOT</grizzly.version>
+ <grizzly.npn.version>1.0</grizzly.npn.version>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-websockets</artifactId>
- <version>2.3.2</version>
+ <version>${grizzly.version}</version>
</dependency>
<dependency>
- <groupId>com.ning</groupId>
- <artifactId>async-http-client-api</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <classifier>tests</classifier>
+ <groupId>org.glassfish.grizzly</groupId>
+ <artifactId>grizzly-spdy</artifactId>
+ <version>${grizzly.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.grizzly</groupId>
+ <artifactId>grizzly-npn-api</artifactId>
+ <version>${grizzly.npn.version}</version>
</dependency>
</dependencies>
Oops, something went wrong.

0 comments on commit 1379ba5

Please sign in to comment.