You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2017/11/15 11:36:22 UTC

[GitHub] forsthofer commented on a change in pull request #340: [CXF-7562] correction for truncated flag

forsthofer commented on a change in pull request #340: [CXF-7562] correction for truncated flag
URL: https://github.com/apache/cxf/pull/340#discussion_r151102002
 
 

 ##########
 File path: rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingOutInterceptor.java
 ##########
 @@ -82,7 +82,10 @@ private OutputStream createCachingOut(Message message, final OutputStream os, Ca
             newOut.setThreshold(threshold);
         }
         if (limit > 0) {
-            newOut.setCacheLimit(limit);
+            // make the limit for the cache greater than the limit for the truncated payload in the log event, 
+            // this is necessary for finding out that the payload was truncated 
+            //(see boolean isTruncated = cos.size() > limit && limit != -1;)  in method copyPayload
+            newOut.setCacheLimit(limit + 1);
 
 Review comment:
   instead of just setting the limit to 'limit +1' one should check whether the limit == Integer.MAX_VALUE and if this is the case just use Integer.MAX_VALUE

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services