tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml
Date Thu, 04 Aug 2005 15:05:31 GMT
remm        2005/08/04 08:05:31

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        DefaultServlet.java
               webapps/docs changelog.xml
  Log:
  - 35978: Bad handling of single range requests greater than 2GB in the
    DefaultServlet.
  
  Revision  Changes    Path
  1.39      +14 -3     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- DefaultServlet.java	5 May 2005 07:00:09 -0000	1.38
  +++ DefaultServlet.java	4 Aug 2005 15:05:31 -0000	1.39
  @@ -809,7 +809,12 @@
                   if (debug > 0)
                       log("DefaultServlet.serveFile:  contentLength=" +
                           contentLength);
  -                response.setContentLength((int) contentLength);
  +                if (contentLength < Integer.MAX_VALUE) {
  +                    response.setContentLength((int) contentLength);
  +                } else {
  +                    // Set the content-length as String to be able to use a long
  +                    response.setHeader("content-length", "" + contentLength);
  +                }
               }
   
               InputStream renderResult = null;
  @@ -854,7 +859,13 @@
                                      + range.start
                                      + "-" + range.end + "/"
                                      + range.length);
  -                response.setContentLength((int) (range.end - range.start + 1));
  +                long length = range.end - range.start + 1;
  +                if (length < Integer.MAX_VALUE) {
  +                    response.setContentLength((int) length);
  +                } else {
  +                    // Set the content-length as String to be able to use a long
  +                    response.setHeader("content-length", "" + length);
  +                }
   
                   if (contentType != null) {
                       if (debug > 0)
  
  
  
  1.354     +4 -0      jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.353
  retrieving revision 1.354
  diff -u -r1.353 -r1.354
  --- changelog.xml	4 Aug 2005 13:06:56 -0000	1.353
  +++ changelog.xml	4 Aug 2005 15:05:31 -0000	1.354
  @@ -79,6 +79,10 @@
           <bug>36020</bug>: Allow MemoryUserDatabase to work better on write
protected mediums,
           submitted by Rainer Jung (remm)
         </fix>
  +      <fix>
  +        <bug>35978</bug>: Bad handling of single range requests greater than
2GB in the DefaultServlet
  +        (remm)
  +      </fix>
       </changelog>
     </subsection>
     
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message