ozeigermann    2004/11/09 12:30:50

  Modified:    src/webdav/server/org/apache/slide/webdav/method Tag:
                        SLIDE_2_1_RELEASE_BRANCH GetMethod.java
  Log:
  Tomcat 5 seems to require to set the buffer size before the content length.
  Fixed this.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.51.2.3  +7 -6      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java
  
  Index: GetMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java,v
  retrieving revision 1.51.2.2
  retrieving revision 1.51.2.3
  diff -u -r1.51.2.2 -r1.51.2.3
  --- GetMethod.java    30 Oct 2004 18:29:15 -0000      1.51.2.2
  +++ GetMethod.java    9 Nov 2004 20:30:50 -0000       1.51.2.3
  @@ -262,6 +262,10 @@
                               ("Last-Modified",
                                
revisionDescriptor.getLastModified().toString());
       
  +                        // do this before setting content length, as Tomcat 
5 seems to be picky
  +                        // about this
  +                        resp.setBufferSize(output);
  +
                           if ( ((ranges == null) || (ranges.isEmpty())) ) {
                               // full content response
                               resp.setContentType
  @@ -272,7 +276,6 @@
                               // Copy the input stream to our output stream
                               // (if requested)
                               if (printContent) {
  -                                resp.setBufferSize(output);
                                   copy(resourceInfo, is, os);
                               }
       
  @@ -293,7 +296,6 @@
                                       (revisionDescriptor.getContentType());
       
                                   if (printContent) {
  -                                    resp.setBufferSize(output);
                                       copy(resourceInfo, is, os, range);
                                   }
       
  @@ -304,7 +306,6 @@
                                            + mimeSeparation);
       
                                   if (printContent) {
  -                                    resp.setBufferSize(output);
                                       copy(resourceInfo, is, os,
                                            ranges.elements(),
                                            
revisionDescriptor.getContentType());
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to