billbarker    2002/06/03 20:09:57

  Modified:    coyote/src/java/org/apache/coyote/tomcat3
                        Tomcat3Response.java
  Log:
  Make certain that content-length gets set on the coyoteRequest.
  
  Long-term, I'd much rather use the header only like in the Tomcat 3.3 core Request.  
However, I can't think of a good reason why it can't wait for v1.1.
  
  Reported By: Keith Wannamaker
  
  Revision  Changes    Path
  1.6       +5 -8      
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/Tomcat3Response.java
  
  Index: Tomcat3Response.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/Tomcat3Response.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Tomcat3Response.java      17 May 2002 19:49:03 -0000      1.5
  +++ Tomcat3Response.java      4 Jun 2002 03:09:56 -0000       1.6
  @@ -92,14 +92,6 @@
           super();
       }
   
  -    /** Set the Content lenth
  -     */
  -    public void setContentLength(int contentLength) {
  -     if(! isIncluded() ){
  -         super.setContentLength(contentLength);
  -         coyoteResponse.setContentLength(contentLength);
  -     }
  -    }
       /** Attach a Coyote Request to this request.
        */
       public void setCoyoteResponse(org.apache.coyote.Response cRes) {
  @@ -126,6 +118,11 @@
       public void endHeaders()  throws IOException {
        super.endHeaders();
        coyoteResponse.setStatus(getStatus());
  +     // Check that the content-length has been set.
  +     int cLen = getContentLength();
  +     if( cLen >= 0 ) {
  +         coyoteResponse.setContentLength(cLen);
  +     }
           // Calls a sendHeaders callback to the protocol
        coyoteResponse.sendHeaders();
       }
  
  
  

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

Reply via email to