On 4/21/2011 1:02 PM, ma...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to