keith 2005/02/27 13:30:52 Modified: coyote/src/java/org/apache/coyote Tag: TOMCAT_5_0 Response.java coyote/src/java/org/apache/coyote/tomcat4 Tag: TOMCAT_5_0 OutputBuffer.java http11/src/java/org/apache/coyote/http11 Tag: TOMCAT_5_0 Http11Processor.java Log: Backport to 50 branch of fix to allow servlets to return multi-gb content-length headers - allow servlets to set content-length > Integer.MAX_VALUE via setHeader() - if servlet sets a content length in this manner, getContentLength will return -1 if cl > Integer.MAX_VALUE, so test getContentLengthLong to see if the cl was set. Revision Changes Path No revision No revision 1.32.2.2 +5 -1 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java Index: Response.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java,v retrieving revision 1.32.2.1 retrieving revision 1.32.2.2 diff -u -r1.32.2.1 -r1.32.2.2 --- Response.java 10 Feb 2005 05:25:41 -0000 1.32.2.1 +++ Response.java 27 Feb 2005 21:30:51 -0000 1.32.2.2 @@ -350,7 +350,7 @@ } if( name.equalsIgnoreCase( "Content-Length" ) ) { try { - int cL=Integer.parseInt( value ); + long cL=Long.parseLong( value ); setContentLength( cL ); return true; } catch( NumberFormatException ex ) { @@ -528,6 +528,10 @@ this.contentLength = contentLength; } + public void setContentLength(long contentLength) { + this.contentLength = contentLength; + } + public int getContentLength() { long length = getContentLengthLong(); No revision No revision 1.13.2.1 +1 -1 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/OutputBuffer.java Index: OutputBuffer.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/OutputBuffer.java,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -r1.13 -r1.13.2.1 --- OutputBuffer.java 24 Feb 2004 08:54:29 -0000 1.13 +++ OutputBuffer.java 27 Feb 2005 21:30:51 -0000 1.13.2.1 @@ -262,7 +262,7 @@ return; if ((!coyoteResponse.isCommitted()) - && (coyoteResponse.getContentLength() == -1)) { + && (coyoteResponse.getContentLengthLong() == -1)) { // Flushing the char buffer if (state == CHAR_STATE) { cb.flushBuffer(); No revision No revision 1.100.2.4 +1 -1 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java Index: Http11Processor.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java,v retrieving revision 1.100.2.3 retrieving revision 1.100.2.4 diff -u -r1.100.2.3 -r1.100.2.4 --- Http11Processor.java 10 Feb 2005 05:25:41 -0000 1.100.2.3 +++ Http11Processor.java 27 Feb 2005 21:30:51 -0000 1.100.2.4 @@ -1385,7 +1385,7 @@ } // Check if suffisant len to trig the compression - int contentLength = response.getContentLength(); + long contentLength = response.getContentLengthLong(); if ((contentLength == -1) || (contentLength > compressionMinSize)) { // Check for compatible MIME-TYPE
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]