coheigea commented on a change in pull request #684:
URL: https://github.com/apache/cxf/pull/684#discussion_r457935331



##########
File path: core/src/main/java/org/apache/cxf/message/Message.java
##########
@@ -196,6 +196,12 @@
      */
     String THREAD_SAFE_STAX_FACTORIES = Message.class.getName() + 
".THREAD_SAFE_STAX_FACTORIES";
 
+
+    /**
+     * Integer property to specify how much bytes client must be able to 
handle.
+     */
+    String MAX_RESPONSE_CONTENT_LENGTH = Message.class.getName() + 
".MAX_RESPONSE_CONTENT_LENGTH";

Review comment:
       I think it's probably better to restrict this configuration variable to 
Netty instead of the CXF Message object, as it only applies to Netty.

##########
File path: 
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
##########
@@ -652,6 +652,25 @@ protected static int determineConnectionTimeout(Message 
message,
         return (int)ctimeout;
     }
 
+    protected static int determineMaxResponseContentLength(Message message,

Review comment:
       Move into Netty subclass.

##########
File path: 
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
##########
@@ -652,6 +652,25 @@ protected static int determineConnectionTimeout(Message 
message,
         return (int)ctimeout;
     }
 
+    protected static int determineMaxResponseContentLength(Message message,
+                                                 HTTPClientPolicy csPolicy) {
+        Integer maxResponseContentLength = 
csPolicy.getMaxResponseContentLength();
+        if (message.get(Message.MAX_RESPONSE_CONTENT_LENGTH) != null) {
+            Object obj = message.get(Message.MAX_RESPONSE_CONTENT_LENGTH);
+            try {
+                maxResponseContentLength = Integer.parseInt(obj.toString());
+            } catch (NumberFormatException e) {
+                LOG.log(Level.WARNING, "INVALID_TIMEOUT_FORMAT", new Object[] {
+                    Message.MAX_RESPONSE_CONTENT_LENGTH, obj.toString()
+                });
+            }
+        }
+        if (maxResponseContentLength == null) {
+            maxResponseContentLength = Integer.MAX_VALUE;

Review comment:
       We should probably default instead to 1048576, which was the previous 
default. Maybe extract this number to a constant.

##########
File path: rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
##########
@@ -390,6 +390,13 @@
                 </xs:documentation>
             </xs:annotation>      
         </xs:attribute>
+        <xs:attribute name="MaxResponseContentLength" 
type="ptp:ParameterizedInt" use="optional" >

Review comment:
       I don't think this is required.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to