cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1398200 - in /cxf/trunk/rt/transports/http/src: main/java/org/apache/cxf/transport/http/ main/java/org/apache/cxf/transport/http/osgi/ main/resources/schemas/wsdl/ test/java/org/apache/cxf/transport/http/spring/
Date Mon, 15 Oct 2012 06:57:21 GMT
Author: ffang
Date: Mon Oct 15 06:57:20 2012
New Revision: 1398200

URL: http://svn.apache.org/viewvc?rev=1398200&view=rev
Log:
[CXF-4555]enable http:conduit to configure the chunk size

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
    cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
    cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java
    cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-bean.xml
    cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-tlsrefs-bean.xml

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1398200&r1=1398199&r2=1398200&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Mon Oct 15 06:57:20 2012
@@ -511,7 +511,6 @@ public abstract class HTTPConduit 
             isChunking = true;
             chunkThreshold = csPolicy.getChunkingThreshold();
         }
-
         cookies.writeToMessageHeaders(message);
 
         // The trust decision is relegated to after the "flushing" of the

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java?rev=1398200&r1=1398199&r2=1398200&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java
Mon Oct 15 06:57:20 2012
@@ -174,7 +174,8 @@ public class URLConnectionHTTPConduit ex
         @Override
         public void thresholdReached() {
             if (chunking) {
-                connection.setChunkedStreamingMode(-1);
+                connection.setChunkedStreamingMode(
+                    URLConnectionHTTPConduit.this.getClient().getChunkLength());
             }
         }
         @Override

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java?rev=1398200&r1=1398199&r2=1398200&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
Mon Oct 15 06:57:20 2012
@@ -525,6 +525,8 @@ public class HTTPTransportActivator 
                     p.setAllowChunking(Boolean.parseBoolean(v.trim()));
                 } else if ("ChunkingThreshold".equals(k)) {
                     p.setChunkingThreshold(Integer.parseInt(v.trim()));
+                } else if ("ChunkLength".equals(k)) {
+                    p.setChunkLength(Integer.parseInt(v.trim()));
                 } else if ("Connection".equals(k)) {
                     p.setConnection(ConnectionType.valueOf(v));
                 } else if ("DecoupledEndpoint".equals(k)) {

Modified: cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd?rev=1398200&r1=1398199&r2=1398200&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd (original)
+++ cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd Mon Oct 15
06:57:20 2012
@@ -239,7 +239,11 @@
                         </xs:documentation>
                     </xs:annotation>      
                 </xs:attribute>
-
+                <xs:attribute name="ChunkLength" type="ptp:ParameterizedInt" use="optional"
default="-1">
+                    <xs:annotation>
+                        <xs:documentation>Specifies the chunk length for a HttpURLConnection.
This value is used in java.net.HttpURLConnection.setChunkedStreamingMode(int chunklen). chunklen
indicates the number of bytes to write in each chunk. If chunklen is less than or equal to
zero, a default value will be used.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
                 <xs:attribute name="Accept" type="xs:string" use="optional">
                     <xs:annotation>
                         <xs:documentation>

Modified: cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java?rev=1398200&r1=1398199&r2=1398200&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java
(original)
+++ cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/HttpConduitConfigurationTest.java
Mon Oct 15 06:57:20 2012
@@ -38,6 +38,7 @@ import org.apache.cxf.configuration.secu
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.cxf.transport.http.HTTPTransportFactory;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
 
 import org.junit.After;
 import org.junit.Assert;
@@ -106,6 +107,8 @@ public class HttpConduitConfigurationTes
         assertNotNull(csfs);
         assertEquals(5, csfs.getInclude().size());
         assertEquals(1, csfs.getExclude().size());
+        HTTPClientPolicy clientPolicy = conduit.getClient();
+        assertEquals(10240, clientPolicy.getChunkLength());
     }
 
     

Modified: cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-bean.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-bean.xml?rev=1398200&r1=1398199&r2=1398200&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-bean.xml
(original)
+++ cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-bean.xml
Mon Oct 15 06:57:20 2012
@@ -55,7 +55,7 @@ http://www.springframework.org/schema/be
 	     <sec:UserName>Betty</sec:UserName>
 	     <sec:Password>password</sec:Password>
 	  </http:authorization>
-      <http:client AutoRedirect="true" Connection="Keep-Alive"/>
+      <http:client AutoRedirect="true" Connection="Keep-Alive" ChunkLength="10240"/>
 
    </http:conduit>    
 </beans>

Modified: cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-tlsrefs-bean.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-tlsrefs-bean.xml?rev=1398200&r1=1398199&r2=1398200&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-tlsrefs-bean.xml
(original)
+++ cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/spring/conduit-tlsrefs-bean.xml
Mon Oct 15 06:57:20 2012
@@ -51,7 +51,7 @@ http://www.springframework.org/schema/be
 	     <sec:UserName>Betty</sec:UserName>
 	     <sec:Password>password</sec:Password>
 	  </http:authorization>
-      <http:client AutoRedirect="true" Connection="Keep-Alive"/>
+      <http:client AutoRedirect="true" ChunkLength="10240" Connection="Keep-Alive"/>
 
    </http:conduit>    
 </beans>



Mime
View raw message