channel.write(new BodyChunkedInput(body)).addListener(new ProgressListener(config, future.getAsyncHandler(), future, false) { public void operationComplete(ChannelFuture cf) { closeSilently(body);
msg = new BodyChunkedInput(body);
channel.write(new BodyChunkedInput(body)).addListener(new ProgressListener(config, future.getAsyncHandler(), future, false) { public void operationComplete(ChannelFuture cf) { closeSilently(body);
@Override public void write(final Channel channel, NettyResponseFuture<?> future, AsyncHttpClientConfig config) throws IOException { Object msg; if (body instanceof RandomAccessBody && !ChannelManager.isSslHandlerConfigured(channel.getPipeline()) && !nettyConfig.isDisableZeroCopy()) { msg = new BodyFileRegion((RandomAccessBody) body); } else { msg = new BodyChunkedInput(body); BodyGenerator bg = future.getRequest().getBodyGenerator(); if (bg instanceof FeedableBodyGenerator) { FeedableBodyGenerator.class.cast(bg).setListener(new FeedListener() { @Override public void onContentAdded() { channel.getPipeline().get(ChunkedWriteHandler.class).resumeTransfer(); } }); } } channel.write(msg).addListener(new ProgressListener(config, future.getAsyncHandler(), future, false) { public void operationComplete(ChannelFuture cf) { closeSilently(body); super.operationComplete(cf); } }); } }