Summary: | RequestDumperFilter contentLength inefficiently creating Integer | ||
---|---|---|---|
Product: | Tomcat 8 | Reporter: | Anthony Whitford <anthony> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | trivial | ||
Priority: | P2 | ||
Version: | 8.0.x-trunk | ||
Target Milestone: | ---- | ||
Hardware: | Macintosh | ||
OS: | Mac OS X 10.1 | ||
Attachments: | Corrects contentLength logging to use less resources |
Hi, Thanks for the report and the patch. I applied the same fix on other places in the code also. The fix is available in trunk, 8.0.x (for 8.0.29 onwards) and 7.0.x (for 7.0.66 onwards) Regards, Violeta Should this usage of request.getContentLength be changed to use request.getHeader("Content-Length") to avoid the 2GiB primitive int limit? I switched to request.getContentLengthLong in trunk and Tomcat 8 trunk Good move, the "efficiency" of the request dumper valve is meaningless, this issue is really nonsense. However, using the int version may not work properly, so that's a real fix. |
Created attachment 33216 [details] Corrects contentLength logging to use less resources The contentLength logging in RequestDumperFilter is calling: Integer.valueOf(request.getContentLength()).toString() instead of: Integer.toString(request.getContentLength())