Author: billbarker Date: Wed Jun 13 18:56:16 2007 New Revision: 547078 URL: http://svn.apache.org/viewvc?view=rev&rev=547078 Log: Porting large-file support for the AJP Connectors from 5.5
Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java tomcat/tc6.0.x/trunk/java/org/apache/jk/common/HandlerRequest.java Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?view=diff&rev=547078&r1=547077&r2=547078 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Wed Jun 13 18:56:16 2007 @@ -680,7 +680,9 @@ if (hId == Constants.SC_REQ_CONTENT_LENGTH || (hId == -1 && tmpMB.equalsIgnoreCase("Content-Length"))) { // just read the content-length header, so set it - request.setContentLength( vMB.getInt() ); + long cl = vMB.getLong(); + if(cl < Integer.MAX_VALUE) + request.setContentLength( (int)cl ); } else if (hId == Constants.SC_REQ_CONTENT_TYPE || (hId == -1 && tmpMB.equalsIgnoreCase("Content-Type"))) { // just read the content-type header, so set it @@ -1204,7 +1206,7 @@ if (endOfStream) { return -1; } - if (first && req.getContentLength() > 0) { + if (first && req.getContentLengthLong() > 0) { // Handle special first-body-chunk if (!receive()) { return 0; Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?view=diff&rev=547078&r1=547077&r2=547078 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Wed Jun 13 18:56:16 2007 @@ -688,7 +688,9 @@ if (hId == Constants.SC_REQ_CONTENT_LENGTH || (hId == -1 && tmpMB.equalsIgnoreCase("Content-Length"))) { // just read the content-length header, so set it - request.setContentLength( vMB.getInt() ); + long cl = vMB.getLong(); + if(cl < Integer.MAX_VALUE) + request.setContentLength( (int)cl ); } else if (hId == Constants.SC_REQ_CONTENT_TYPE || (hId == -1 && tmpMB.equalsIgnoreCase("Content-Type"))) { // just read the content-type header, so set it @@ -1144,7 +1146,7 @@ if (endOfStream) { return -1; } - if (first && req.getContentLength() > 0) { + if (first && req.getContentLengthLong() > 0) { // Handle special first-body-chunk if (!receive()) { return 0; Modified: tomcat/tc6.0.x/trunk/java/org/apache/jk/common/HandlerRequest.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jk/common/HandlerRequest.java?view=diff&rev=547078&r1=547077&r2=547078 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/jk/common/HandlerRequest.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/jk/common/HandlerRequest.java Wed Jun 13 18:56:16 2007 @@ -407,7 +407,7 @@ // Check to see if there should be a body packet coming along // immediately after - int cl=req.getContentLength(); + long cl=req.getContentLengthLong(); if(cl > 0) { JkInputStream jkIS = ep.getInputStream(); jkIS.setIsReadRequired(true); @@ -577,7 +577,9 @@ if (hId == AjpConstants.SC_REQ_CONTENT_LENGTH || (hId == -1 && tmpMB.equalsIgnoreCase("Content-Length"))) { // just read the content-length header, so set it - req.setContentLength( vMB.getInt() ); + long cl = vMB.getLong(); + if(cl < Integer.MAX_VALUE) + req.setContentLength( (int)cl ); } else if (hId == AjpConstants.SC_REQ_CONTENT_TYPE || (hId == -1 && tmpMB.equalsIgnoreCase("Content-Type"))) { // just read the content-type header, so set it --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]