billbarker    02/02/01 19:24:32

  Modified:    src/share/org/apache/tomcat/util/net TcpConnection.java
  Log:
  Make this a bit smarter about skipping un-read input.
  
  This does much the same thing in the case of a buggy browser adding \r\n to the POST 
body.  However, it fixes the problem when the servlet doesn't finish reading the body 
of a big upload.  Also, leaving even one byte behind can cause problems for people 
connecting via a proxy server.
  
  Fix for bug 5983
  Reported by: Olaf Jahn [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.3       +5 -4      
jakarta-tomcat/src/share/org/apache/tomcat/util/net/TcpConnection.java
  
  Index: TcpConnection.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/net/TcpConnection.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TcpConnection.java        24 Sep 2000 17:33:44 -0000      1.2
  +++ TcpConnection.java        2 Feb 2002 03:24:32 -0000       1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/net/TcpConnection.java,v 1.2 
2000/09/24 17:33:44 costin Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/09/24 17:33:44 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/net/TcpConnection.java,v 1.3 
2002/02/02 03:24:32 billbarker Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/02/02 03:24:32 $
    *
    * ====================================================================
    *
  @@ -134,8 +134,9 @@
            // was added just to deal with such issues.
            
            // skip any unread (bogus) bytes
  -         if (available > 1) {
  +         while (available > 0) {
                is.skip (available);
  +             available = is.available();
            }
        }catch(NullPointerException npe) {
            // do nothing - we are just cleaning up, this is
  
  
  

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

Reply via email to