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-4.0/catalina/src/share/org/apache/catalina/connector/http HttpResponseImpl.java HttpResponseStream.java
Date Thu, 08 Mar 2001 23:55:39 GMT
remm        01/03/08 15:55:39

  Modified:    catalina/src/share/org/apache/catalina/connector/http
                        HttpResponseImpl.java HttpResponseStream.java
  Log:
  - Status code < 200, as well as not modified and no content musn't have
    a response body.
  - Also, allow chunking with status 206.
  
  Revision  Changes    Path
  1.9       +22 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseImpl.java
  
  Index: HttpResponseImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HttpResponseImpl.java	2001/03/06 05:07:45	1.8
  +++ HttpResponseImpl.java	2001/03/08 23:55:35	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseImpl.java,v
1.8 2001/03/06 05:07:45 remm Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/03/06 05:07:45 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseImpl.java,v
1.9 2001/03/08 23:55:35 remm Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/03/08 23:55:35 $
    *
    * ====================================================================
    *
  @@ -79,7 +79,7 @@
    *
    * @author Craig R. McClanahan
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.8 $ $Date: 2001/03/06 05:07:45 $
  + * @version $Revision: 1.9 $ $Date: 2001/03/08 23:55:35 $
    */
   
   final class HttpResponseImpl
  @@ -266,7 +266,9 @@
   
           if (getStatus() < HttpServletResponse.SC_BAD_REQUEST) {
               if ((!isStreamInitialized()) && (getContentLength() == -1)
  -                && (getStatus() != SC_NOT_MODIFIED))
  +                && (getStatus() >= 200)
  +                && (getStatus() != SC_NOT_MODIFIED) 
  +                && (getStatus() != SC_NO_CONTENT))
                   setContentLength(0);
           } else {
               setHeader("Connection", "close");
  @@ -277,6 +279,21 @@
   
   
       // -------------------------------------------- HttpServletResponse Methods
  +
  +
  +    /**
  +     * Set the HTTP status to be returned with this response.
  +     *
  +     * @param status The new HTTP status
  +     */
  +    public void setStatus(int status) {
  +
  +        super.setStatus(status);
  +
  +        if (responseStream != null)
  +            responseStream.checkChunking(this);
  +
  +    }
   
   
       /**
  
  
  
  1.5       +3 -4      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseStream.java
  
  Index: HttpResponseStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseStream.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HttpResponseStream.java	2000/11/09 20:15:50	1.4
  +++ HttpResponseStream.java	2001/03/08 23:55:36	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseStream.java,v
1.4 2000/11/09 20:15:50 remm Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/11/09 20:15:50 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpResponseStream.java,v
1.5 2001/03/08 23:55:36 remm Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/03/08 23:55:36 $
    *
    * ====================================================================
    * 
  @@ -189,7 +189,6 @@
           useChunking = 
               (!response.isCommitted()
                && response.getContentLength() == -1
  -             && response.getStatus() != HttpServletResponse.SC_PARTIAL_CONTENT
                && response.getStatus() != HttpServletResponse.SC_NOT_MODIFIED);
           if (!response.isChunkingAllowed() && useChunking) {
               // If we should chunk, but chunking is forbidden by the connector,
  
  
  

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


Mime
View raw message