tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiro Takahashi" <h...@routefree.com>
Subject [PATCH] Bug fix for #1678
Date Thu, 24 May 2001 06:32:35 GMT
This is the fix for ServletInputStream.read() bug.
    #1678: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1678
The change is in Ajp13ConnectorRequest.java. This one is obviously
the one which has not been tested with a binary data.
I made this patch for 3.2.1.

Index: Ajp13ConnectorRequest.java
===================================================================
RCS file: jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v
retrieving revision 1.1
diff -u -r1.1 Ajp13ConnectorRequest.java
--- Ajp13ConnectorRequest.java	2001/05/23 22:41:09	1.1
+++ Ajp13ConnectorRequest.java	2001/05/24 06:20:53
@@ -251,8 +251,12 @@
     {
         if(pos >= blen) {
             refeelReadBuffer();
+	    if (pos>= blen) {
+		// seems no data
+		return -1;
+	    }
         }
-        return bodyBuff[pos++];
+        return bodyBuff[pos++] & 0xff;
     }
     
     public int doRead(byte[] b, int off, int len) throws IOException 
@@ -261,7 +265,6 @@
         for(int i = off ; i < (len + off) ; i++) {
             int a = doRead();
             if(-1 == a) {
-                System.out.println("Y");
                 return i-off;
             }
             b[i] = (byte)a;


Mime
View raw message