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 SocketInputStream.java
Date Wed, 22 Nov 2000 02:28:20 GMT
remm        00/11/21 18:28:20

  Modified:    catalina/src/share/org/apache/catalina/connector/http
                        SocketInputStream.java
  Log:
  - Avoid throwing an ArrayOutOfBoundException when the client disconnects
    before starting a new request.
  
  Revision  Changes    Path
  1.3       +9 -4      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java
  
  Index: SocketInputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SocketInputStream.java	2000/11/17 07:25:36	1.2
  +++ SocketInputStream.java	2000/11/22 02:28:19	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
1.2 2000/11/17 07:25:36 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/11/17 07:25:36 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/SocketInputStream.java,v
1.3 2000/11/22 02:28:19 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/11/22 02:28:19 $
    *
    * ====================================================================
    * 
  @@ -67,6 +67,7 @@
   import java.io.IOException;
   import java.io.BufferedInputStream;
   import java.io.InputStream;
  +import java.io.EOFException;
   import org.apache.catalina.util.StringManager;
   
   /**
  @@ -166,6 +167,9 @@
           while ((chr = read()) == CR) { // Skipping CR
               read(); // Skipping LF
           }
  +        if (chr == -1)
  +            throw new EOFException
  +                (sm.getString("requestStream.readline.error"));
           if (chr != CR) {
               pos--;
           }
  @@ -457,7 +461,8 @@
                       eol = true;
                   } else {
                       // FIXME : Check if binary conversion is working fine
  -                    header.value[readCount] = (char) (buf[pos] & 0xff);
  +                    int ch = buf[pos] & 0xff;
  +                    header.value[readCount] = (char) ch;
                       readCount++;
                   }
                   pos++;
  
  
  

Mime
View raw message