tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpRequestImpl.java HttpRequestStream.java
Date Sat, 02 Dec 2000 03:52:57 GMT
remm        00/12/01 19:52:57

  Modified:    catalina/src/share/org/apache/catalina/connector
                        RequestBase.java
               catalina/src/share/org/apache/catalina/connector/http
                        HttpRequestImpl.java HttpRequestStream.java
  Log:
  - Will only attempt to consume leftover bytes if the request was an HTTP/1.1
    request.
  
  Revision  Changes    Path
  1.8       +4 -9      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java
  
  Index: RequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RequestBase.java	2000/11/17 02:58:59	1.7
  +++ RequestBase.java	2000/12/02 03:52:55	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
1.7 2000/11/17 02:58:59 remm Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/11/17 02:58:59 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
1.8 2000/12/02 03:52:55 remm Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/12/02 03:52:55 $
    *
    * ====================================================================
    *
  @@ -97,7 +97,7 @@
    * the connector-specific methods need to be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.7 $ $Date: 2000/11/17 02:58:59 $
  + * @version $Revision: 1.8 $ $Date: 2000/12/02 03:52:55 $
    */
   
   public abstract class RequestBase
  @@ -482,11 +482,6 @@
        * @exception IOException if an input/output error occurs
        */
       public void finishRequest() throws IOException {
  -
  -        // If neither a reader or an is have been opened, do it to consume
  -        // request bytes, if any
  -        if ((reader == null) && (stream == null) && (getContentLength()
!= 0))
  -            getInputStream();
   
   	// If a Reader has been acquired, close it
   	if (reader != null) {
  
  
  
  1.4       +23 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java
  
  Index: HttpRequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HttpRequestImpl.java	2000/11/24 19:55:20	1.3
  +++ HttpRequestImpl.java	2000/12/02 03:52:56	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v
1.3 2000/11/24 19:55:20 remm Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/11/24 19:55:20 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v
1.4 2000/12/02 03:52:56 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/12/02 03:52:56 $
    *
    * ====================================================================
    *
  @@ -79,7 +79,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.3 $ $Date: 2000/11/24 19:55:20 $
  + * @version $Revision: 1.4 $ $Date: 2000/12/02 03:52:56 $
    */
   
   final class HttpRequestImpl
  @@ -286,6 +286,25 @@
                   return headerPool[i];
           }
           return null;
  +
  +    }
  +
  +
  +    /**
  +     * Perform whatever actions are required to flush and close the input
  +     * stream or reader, in a single operation.
  +     *
  +     * @exception IOException if an input/output error occurs
  +     */
  +    public void finishRequest() throws IOException {
  +
  +        // If neither a reader or an is have been opened, do it to consume
  +        // request bytes, if any
  +        if ((reader == null) && (stream == null) && (getContentLength()
!= 0)
  +            && (getProtocol().equals("HTTP/1.1")))
  +            getInputStream();
  +
  +        super.finishRequest();
   
       }
   
  
  
  
  1.3       +15 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java
  
  Index: HttpRequestStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HttpRequestStream.java	2000/10/10 17:09:25	1.2
  +++ HttpRequestStream.java	2000/12/02 03:52:56	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v
1.2 2000/10/10 17:09:25 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/10/10 17:09:25 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v
1.3 2000/12/02 03:52:56 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/12/02 03:52:56 $
    *
    * ====================================================================
    * 
  @@ -99,6 +99,10 @@
               response.addHeader("Connection", "close");
           }
   
  +        http11 = request.getProtocol().equals("HTTP/1.1");
  +        
  +        System.out.println("HTTP/1.1: " + http11);
  +        
       }
       
       
  @@ -135,6 +139,12 @@
       protected int chunkPos = 0;
       
       
  +    /**
  +     * HTTP/1.1 flag.
  +     */
  +    protected boolean http11 = false;
  +    
  +    
       // --------------------------------------------------------- Public Methods
       
       
  @@ -160,8 +170,9 @@
               
           } else {
               
  -            if (length > 0) {
  +            if (http11 && (length > 0)) {
                   while (count < length) {
  +                    System.out.println("Consuming bytes");
                       int b = read();
                       if (b < 0)
                           break;
  
  
  

Mime
View raw message