tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Saegesser" <marc.saeges...@apropos.com>
Subject RE: [PATCH] Bug fix for #1678
Date Thu, 24 May 2001 13:02:42 GMT
This was fixed in Tomcat 3.2.2 quite some time ago.  Check out the tip of
the tomcat_32 branch and look at the connector code again.

> -----Original Message-----
> From: Hiro Takahashi [mailto:hiro@routefree.com]
> Sent: Thursday, May 24, 2001 1:33 AM
> To: tomcat-dev@jakarta.apache.org
> Subject: [PATCH] Bug fix for #1678
>
>
> 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/Ajp13
ConnectorRequest.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