@Override public void thresholdReached() { if (chunking) { connection.setChunkedStreamingMode( URLConnectionHTTPConduit.this.getClient().getChunkLength()); } } @Override
protected NettyWrappedOutputStream(Message message, boolean possibleRetransmit, boolean isChunking, int chunkThreshold, String conduitName, URI url) { super(message, possibleRetransmit, isChunking, chunkThreshold, conduitName, url); csPolicy = getClient(message); entity = message.get(NettyHttpClientRequest.class); int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() : 16320; outBuffer = Unpooled.buffer(bufSize); outputStream = new ByteBufOutputStream(outBuffer); }
protected NettyWrappedOutputStream(Message message, boolean possibleRetransmit, boolean isChunking, int chunkThreshold, String conduitName, URI url) { super(message, possibleRetransmit, isChunking, chunkThreshold, conduitName, url); csPolicy = getClient(message); entity = message.get(NettyHttpClientRequest.class); int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() : 16320; outBuffer = Unpooled.buffer(bufSize); outputStream = new ByteBufOutputStream(outBuffer); }
@Override public void thresholdReached() { if (chunking) { connection.setChunkedStreamingMode( URLConnectionHTTPConduit.this.getClient().getChunkLength()); } } @Override
@Override public void thresholdReached() { if (chunking) { connection.setChunkedStreamingMode( URLConnectionHTTPConduit.this.getClient().getChunkLength()); } } @Override
public AsyncWrappedOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold, String conduitName, URI uri) { super(message, needToCacheRequest, isChunking, chunkThreshold, conduitName, uri); csPolicy = getClient(message); entity = message.get(CXFHttpRequest.class); basicEntity = (BasicHttpEntity)entity.getEntity(); basicEntity.setChunked(isChunking); HeapByteBufferAllocator allocator = new HeapByteBufferAllocator(); int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() : 16320; inbuf = new SharedInputBuffer(bufSize, allocator); outbuf = new SharedOutputBuffer(bufSize, allocator); isAsync = outMessage != null && outMessage.getExchange() != null && !outMessage.getExchange().isSynchronous(); }
protected void setupNewConnection(String newURL) throws IOException { httpResponse = null; isAsync = outMessage != null && outMessage.getExchange() != null && !outMessage.getExchange().isSynchronous(); exception = null; connectionFuture = null; session = null; sslState = null; sslURL = null; //reset the buffers HeapByteBufferAllocator allocator = new HeapByteBufferAllocator(); int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() : 16320; inbuf = new SharedInputBuffer(bufSize, allocator); outbuf = new SharedOutputBuffer(bufSize, allocator); try { if (defaultAddress.getString().equals(newURL)) { setupConnection(outMessage, defaultAddress, csPolicy); } else { Address address = new Address(newURL); this.url = address.getURI(); setupConnection(outMessage, address, csPolicy); } entity = outMessage.get(CXFHttpRequest.class); basicEntity = (BasicHttpEntity)entity.getEntity(); entity.setOutputStream(this); } catch (URISyntaxException e) { throw new IOException(e); } }
.setBufferSize(clientPolicy.getChunkLength() > 0 ? clientPolicy.getChunkLength() : 16332) .build();