|
85 | 85 | importorg.jboss.netty.handler.codec.http.HttpChunk; |
86 | 86 | importorg.jboss.netty.handler.codec.http.HttpChunkTrailer; |
87 | 87 | importorg.jboss.netty.handler.codec.http.HttpClientCodec; |
88 | | -importorg.jboss.netty.handler.codec.http.HttpContentCompressor; |
89 | 88 | importorg.jboss.netty.handler.codec.http.HttpContentDecompressor; |
90 | 89 | importorg.jboss.netty.handler.codec.http.HttpHeaders; |
91 | 90 | importorg.jboss.netty.handler.codec.http.HttpMethod; |
|
159 | 158 |
|
160 | 159 | publicclassNettyAsyncHttpProviderextendsSimpleChannelUpstreamHandlerimplementsAsyncHttpProvider { |
161 | 160 |
|
| 161 | +privatestaticfinalLoggerLOGGER =LoggerFactory.getLogger(NettyAsyncHttpProvider.class); |
| 162 | + |
162 | 163 | publicstaticfinalStringGZIP_DEFLATE =HttpHeaders.Values.GZIP +"," +HttpHeaders.Values.DEFLATE; |
163 | 164 |
|
164 | 165 | publicstaticfinalIOExceptionREMOTELY_CLOSED_EXCEPTION =newIOException("Remotely Closed"); |
@@ -224,6 +225,10 @@ public NettyAsyncHttpProvider(AsyncHttpClientConfig config) { |
224 | 225 | asyncHttpProviderConfig =newNettyAsyncHttpProviderConfig(); |
225 | 226 | } |
226 | 227 |
|
| 228 | +if (config.getRequestCompressionLevel() >0) { |
| 229 | +LOGGER.warn("Request was enabled but Netty actually doesn't support this feature"); |
| 230 | + } |
| 231 | + |
227 | 232 | if (asyncHttpProviderConfig.getProperty(USE_BLOCKING_IO) !=null) { |
228 | 233 | socketChannelFactory =newOioClientSocketChannelFactory(config.executorService()); |
229 | 234 | this.allowReleaseSocketChannelFactory =true; |
@@ -305,10 +310,6 @@ public ChannelPipeline getPipeline() throws Exception { |
305 | 310 |
|
306 | 311 | pipeline.addLast(HTTP_HANDLER,createHttpClientCodec()); |
307 | 312 |
|
308 | | -if (config.getRequestCompressionLevel() >0) { |
309 | | -pipeline.addLast("deflater",newHttpContentCompressor(config.getRequestCompressionLevel())); |
310 | | - } |
311 | | - |
312 | 313 | if (config.isCompressionEnabled()) { |
313 | 314 | pipeline.addLast("inflater",newHttpContentDecompressor()); |
314 | 315 | } |
|