Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4066b17

Browse files
author
Stephane Landelle
committed
Issue a warning when RequestCompression is enabled, seeAsyncHttpClient#93
1 parent51b10cc commit4066b17

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
importorg.jboss.netty.handler.codec.http.HttpChunk;
8686
importorg.jboss.netty.handler.codec.http.HttpChunkTrailer;
8787
importorg.jboss.netty.handler.codec.http.HttpClientCodec;
88-
importorg.jboss.netty.handler.codec.http.HttpContentCompressor;
8988
importorg.jboss.netty.handler.codec.http.HttpContentDecompressor;
9089
importorg.jboss.netty.handler.codec.http.HttpHeaders;
9190
importorg.jboss.netty.handler.codec.http.HttpMethod;
@@ -159,6 +158,8 @@
159158

160159
publicclassNettyAsyncHttpProviderextendsSimpleChannelUpstreamHandlerimplementsAsyncHttpProvider {
161160

161+
privatestaticfinalLoggerLOGGER =LoggerFactory.getLogger(NettyAsyncHttpProvider.class);
162+
162163
publicstaticfinalStringGZIP_DEFLATE =HttpHeaders.Values.GZIP +"," +HttpHeaders.Values.DEFLATE;
163164

164165
publicstaticfinalIOExceptionREMOTELY_CLOSED_EXCEPTION =newIOException("Remotely Closed");
@@ -224,6 +225,10 @@ public NettyAsyncHttpProvider(AsyncHttpClientConfig config) {
224225
asyncHttpProviderConfig =newNettyAsyncHttpProviderConfig();
225226
}
226227

228+
if (config.getRequestCompressionLevel() >0) {
229+
LOGGER.warn("Request was enabled but Netty actually doesn't support this feature");
230+
}
231+
227232
if (asyncHttpProviderConfig.getProperty(USE_BLOCKING_IO) !=null) {
228233
socketChannelFactory =newOioClientSocketChannelFactory(config.executorService());
229234
this.allowReleaseSocketChannelFactory =true;
@@ -305,10 +310,6 @@ public ChannelPipeline getPipeline() throws Exception {
305310

306311
pipeline.addLast(HTTP_HANDLER,createHttpClientCodec());
307312

308-
if (config.getRequestCompressionLevel() >0) {
309-
pipeline.addLast("deflater",newHttpContentCompressor(config.getRequestCompressionLevel()));
310-
}
311-
312313
if (config.isCompressionEnabled()) {
313314
pipeline.addLast("inflater",newHttpContentDecompressor());
314315
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp