You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2001/01/16 19:30:44 UTC

cvs commit: jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector HttpRequestBase.java

remm        01/01/16 10:30:43

  Modified:    catalina/src/share/org/apache/catalina/connector
                        HttpRequestBase.java
  Log:
  - Won't try to read FORM parameters if the servlet has already opened the
    request stream. If you decide to parse the
    request yourself, getParameterNames and getParameterValues will return
    empty enumerations (as there's no way they can be initialized unless the
    servlet container is allowed to parse the request).
    OTOH, if the servlet
    container is allowed to parse the request, then there won't be any bytes
    left to be read on the InputStream.
    If you feel that something else should be done, tell me.
    Should fix bug #783.
    I'll apply the patch to TC 4.0 after making sure the patch is valid.
  
  Revision  Changes    Path
  1.14      +7 -6      jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java
  
  Index: HttpRequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- HttpRequestBase.java	2000/11/15 00:52:35	1.13
  +++ HttpRequestBase.java	2001/01/16 18:30:40	1.14
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v 1.13 2000/11/15 00:52:35 remm Exp $
  - * $Revision: 1.13 $
  - * $Date: 2000/11/15 00:52:35 $
  + * $Header: /home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v 1.14 2001/01/16 18:30:40 remm Exp $
  + * $Revision: 1.14 $
  + * $Date: 2001/01/16 18:30:40 $
    *
    * ====================================================================
    *
  @@ -98,7 +98,7 @@
    * be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.13 $ $Date: 2000/11/15 00:52:35 $
  + * @version $Revision: 1.14 $ $Date: 2001/01/16 18:30:40 $
    */
   
   public class HttpRequestBase
  @@ -594,8 +594,9 @@
           int semicolon = contentType.indexOf(";");
           if (semicolon >= 0)
               contentType = contentType.substring(0, semicolon).trim();
  -	if ("POST".equals(getMethod()) && (getContentLength() > 0) &&
  -	    "application/x-www-form-urlencoded".equals(contentType)) {
  +	if ("POST".equals(getMethod()) && (getContentLength() > 0)
  +            && (this.stream == null)
  +	    && "application/x-www-form-urlencoded".equals(contentType)) {
   	    try {
                   int max = getContentLength();
                   int len = 0;