|
85 | 85 | import org.jboss.netty.handler.codec.http.HttpChunk;
|
86 | 86 | import org.jboss.netty.handler.codec.http.HttpChunkTrailer;
|
87 | 87 | import org.jboss.netty.handler.codec.http.HttpClientCodec;
|
88 |
| -import org.jboss.netty.handler.codec.http.HttpContentCompressor; |
89 | 88 | import org.jboss.netty.handler.codec.http.HttpContentDecompressor;
|
90 | 89 | import org.jboss.netty.handler.codec.http.HttpHeaders;
|
91 | 90 | import org.jboss.netty.handler.codec.http.HttpMethod;
|
|
159 | 158 |
|
160 | 159 | public class NettyAsyncHttpProvider extends SimpleChannelUpstreamHandler implements AsyncHttpProvider {
|
161 | 160 |
|
| 161 | + private static final Logger LOGGER = LoggerFactory.getLogger(NettyAsyncHttpProvider.class); |
| 162 | + |
162 | 163 | public static final String GZIP_DEFLATE = HttpHeaders.Values.GZIP + "," + HttpHeaders.Values.DEFLATE;
|
163 | 164 |
|
164 | 165 | public static final IOException REMOTELY_CLOSED_EXCEPTION = new IOException("Remotely Closed");
|
@@ -224,6 +225,10 @@ public NettyAsyncHttpProvider(AsyncHttpClientConfig config) {
|
224 | 225 | asyncHttpProviderConfig = new NettyAsyncHttpProviderConfig();
|
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 = new OioClientSocketChannelFactory(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", new HttpContentCompressor(config.getRequestCompressionLevel())); |
310 |
| - } |
311 |
| - |
312 | 313 | if (config.isCompressionEnabled()) {
|
313 | 314 | pipeline.addLast("inflater", new HttpContentDecompressor());
|
314 | 315 | }
|
|
0 commit comments