tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector HttpRequestBase.java
Date Mon, 22 Apr 2002 00:00:51 GMT
glenn       02/04/21 17:00:50

  Modified:    catalina/src/share/org/apache/catalina/connector
                        HttpRequestBase.java
  Log:
  Add logging to help track down mod_jk HTTP Post content length bug
  
  Revision  Changes    Path
  1.39      +34 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java
  
  Index: HttpRequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- HttpRequestBase.java	9 Apr 2002 12:53:45 -0000	1.38
  +++ HttpRequestBase.java	22 Apr 2002 00:00:50 -0000	1.39
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
1.38 2002/04/09 12:53:45 glenn Exp $
  - * $Revision: 1.38 $
  - * $Date: 2002/04/09 12:53:45 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpRequestBase.java,v
1.39 2002/04/22 00:00:50 glenn Exp $
  + * $Revision: 1.39 $
  + * $Date: 2002/04/22 00:00:50 $
    *
    * ====================================================================
    *
  @@ -87,6 +87,7 @@
   import javax.servlet.http.HttpSession;
   import org.apache.catalina.Globals;
   import org.apache.catalina.HttpRequest;
  +import org.apache.catalina.Logger;
   import org.apache.catalina.Manager;
   import org.apache.catalina.Realm;
   import org.apache.catalina.Session;
  @@ -103,7 +104,7 @@
    * be implemented.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.38 $ $Date: 2002/04/09 12:53:45 $
  + * @version $Revision: 1.39 $ $Date: 2002/04/22 00:00:50 $
    * @deprecated
    */
   
  @@ -663,6 +664,24 @@
                   }
                   is.close();
                   if (len < max) {
  +                    // FIX ME, mod_jk when sending an HTTP POST will sometimes
  +                    // have an actual content length received < content length.
  +                    // Checking for a read of -1 above prevents this code from
  +                    // going into an infinite loop.  But the bug must be in mod_jk.
  +                    // Log additional data when this occurs to help debug mod_jk
  +                    StringBuffer msg = new StringBuffer();
  +                    msg.append("HttpRequestBase.parseParameters content length mismatch\n");
  +                    msg.append("  URL: ");
  +                    msg.append(getRequestURL());
  +                    msg.append(" Content Length: ");
  +                    msg.append(max);
  +                    msg.append(" Read: ");
  +                    msg.append(len);
  +                    msg.append("\n  Bytes Read: ");
  +                    if ( len > 0 ) {
  +                        msg.append(new String(buf,0,len));
  +                    }
  +                    log(msg.toString());
                       throw new RuntimeException
                           (sm.getString("httpRequestBase.contentLengthMismatch"));
                   }
  @@ -1284,5 +1303,16 @@
   
       }
   
  +
  +    private void log(String message) {
  +        Logger logger = context.getLogger();
  +        logger.log(message);
  +    }
  +     
  +     
  +    private void log(String message, Throwable throwable) {
  +        Logger logger = context.getLogger();
  +        logger.log(message, throwable);
  +    }
   
   }
  
  
  

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


Mime
View raw message