tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: svn commit: r1095794 - in /tomcat/trunk: java/org/apache/coyote/http11/Http11Processor.java webapps/docs/changelog.xml
Date Thu, 21 Apr 2011 19:25:43 GMT
On 4/21/2011 1:02 PM, markt@apache.org wrote:
> +                    int firstReadTimeout;
> +                    if (queueTime>= standardTimeout) {
> +                        // Queued for longer than timeout but there might be
> +                        // data so use shortest possible timeout
> +                        firstReadTimeout = 1;
> +                    } else {
> +                        // Cast is safe since queueTime must be less than
> +                        // standardTimeout which is an int
> +                        firstReadTimeout = standardTimeout - (int) queueTime;
> +                    }
> +                    socket.getSocket().setSoTimeout(firstReadTimeout);
> +                    if (!inputBuffer.fill()) {
> +                        throw new EOFException(sm.getString("iib.eof.error"));
>                       }
>                   }
> +                if (standardTimeout>  0) {
> +                    socket.getSocket().setSoTimeout(standardTimeout);
> +                }
> +
>                   inputBuffer.parseRequestLine(false);
not fully understanding the logic here. But if you ever run into a case where standardTimeout=0
and firstReadTimeout=1, then you'd have 1 
millisecond timeout for the parse request line. And the request line, typically comes in one
packet, but it is legal to send it up in two. 
And you'd have an invalid SocketTimeoutException here, since 1 is no longer the correct timeout.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message