tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Fix for Tomcat 3.2 TcpConnector.receive() Problem
Date Sat, 04 Nov 2000 20:07:35 GMT
Mark,

I just checked in a slight generalization of this change (the read of the four-byte
header could fail in the same way.  I forgot to give you credit in the CVS commit
:-(, but thaks for the bug report.  Please test this (with your large servlet
requests) when you can.

Craig



Mark Pollard wrote:

> I am running Tomcat 3.2 with Apache 1.3.12 under Windows NT 4.0/Service
> Pack 5 using the JRE 1.2.2 w/o Hotspot.  I was getting the message
> "Incomplete read, deal with it" when sending servlet requests > ~1.5KB.
> In short, I dealt with it by continuing to read until the full request has
> been read from the socket InputStream.
>
> I apologize for not properly posting this patch.  I am under time
> constraints and do not have time to "learn" the appropriate method.
>
> class: org.apache.tomcat.service.connector.TcpConnector
> method: public int receive(MsgBuffer msg)
>
> -- NEW ---------------
>
>         // XXX check if enough space - it's assert()-ed !!!
>         // Can we have only one read ( with unblocking, it can read all at once -
> but maybe more ) ?
>         //???   len-=4; // header
>
>   int offset = 4 ;
>   int remainingLength = len ;
>   do  {
>       rd=in.read( b, offset, remainingLength );
>       offset += rd ;
>       remainingLength -= rd ;
>       }
>   while (remainingLength > 0) ;
>
> -- OLD ---------------
>
>         // XXX check if enough space - it's assert()-ed !!!
>         // Can we have only one read ( with unblocking, it can read all at once -
> but maybe more ) ?
>         //???   len-=4; // header
>
>         rd=in.read( b, 4, len );
>         if( rd != len ) {
>             System.out.println( "Incomplete read, deal with it " + len + " " +
> rd);
>             // ??? log
>         }
>
> --
> Mark Pollard
> PanGo Networks, Inc.
> http://www.pangonetworks.com


Mime
View raw message