cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1398703 - in /cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient: AsyncHTTPConduit.java AsyncHTTPConduitFactory.java
Date Tue, 16 Oct 2012 09:08:38 GMT
Author: ffang
Date: Tue Oct 16 09:08:38 2012
New Revision: 1398703

URL: http://svn.apache.org/viewvc?rev=1398703&view=rev
Log:
[CXF-4555]apply http:conduit ChunkLength configuration to async HTTP transport as well

Modified:
    cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
    cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java

Modified: cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java?rev=1398703&r1=1398702&r2=1398703&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
Tue Oct 16 09:08:38 2012
@@ -248,8 +248,9 @@ public class AsyncHTTPConduit extends UR
             entity = message.get(CXFHttpRequest.class);
             basicEntity = (BasicHttpEntity)entity.getEntity();
             HeapByteBufferAllocator allocator = new HeapByteBufferAllocator();
-            inbuf = new SharedInputBuffer(16320, allocator);
-            outbuf = new SharedOutputBuffer(16320, allocator);
+            int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() :
16320;
+            inbuf = new SharedInputBuffer(bufSize, allocator);
+            outbuf = new SharedOutputBuffer(bufSize, allocator);
         }
         
         public boolean retransmitable() {
@@ -711,8 +712,9 @@ public class AsyncHTTPConduit extends UR
             
             //reset the buffers
             HeapByteBufferAllocator allocator = new HeapByteBufferAllocator();
-            inbuf = new SharedInputBuffer(16320, allocator);
-            outbuf = new SharedOutputBuffer(16320, allocator);
+            int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() :
16320;
+            inbuf = new SharedInputBuffer(bufSize, allocator);
+            outbuf = new SharedOutputBuffer(bufSize, allocator);
             try {
                 this.url = new URI(newURL);
                 setupConnection(outMessage, this.url, csPolicy);

Modified: cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java?rev=1398703&r1=1398702&r2=1398703&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
(original)
+++ cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
Tue Oct 16 09:08:38 2012
@@ -402,7 +402,8 @@ public class AsyncHTTPConduitFactory imp
                 HttpParams params = new SyncBasicHttpParams();
                 HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
                 HttpConnectionParams.setTcpNoDelay(params, true);
-                HttpConnectionParams.setSocketBufferSize(params, 16332);
+                int bufSize = c.getClient().getChunkLength() > 0 ? c.getClient().getChunkLength()
: 16332;
+                HttpConnectionParams.setSocketBufferSize(params, bufSize);
                 HttpConnectionParams.setConnectionTimeout(params, (int)c.getClient().getConnectionTimeout());
                 return params;
             }



Mime
View raw message