tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: POST request with timeout acts weird
Date Sun, 04 Oct 2009 20:23:42 GMT
Hash: SHA1


On 10/2/2009 9:20 AM, Ronald Klop wrote:
> But I don't send any data. My servlet than waits in getParameterMap(),
> because that try's to read the inputstream and parse the parameters.
> After 20 seconds (Connector has connectionTimeout="20000") the reading
> of the inputstream ends, but my application just gets an empty Map in
> stead of some TimeoutException.

What leads you to believe that a TimeoutException would be thrown? The
documentation for the HTTP connector's "connectionTimeout" attribute says:

The number of milliseconds this Connector will wait, after accepting a
connection, for the request URI line to be presented. The default value
is 60000 (i.e. 60 seconds).

You provided the URI line within plenty of time. If you didn't enter
anything, Tomcat would disconnect. Since you did, it doesn't.

> Why? And how should I handle this?

Honestly, I'm not sure if there's a way to check to see if all bytes
advertised in Content-Length were actually consumed by a request.

> (The real problem is that IE has some issue's and that some of my
> customers sometimes send synchronous ajax calls which don't send any
> data. I'm investigating that too. If somebody has a tip about that it is
> also appreciated.)

Technically speaking, the HTTP spec does not require the Content-Length
to be correct(!). I think this is something that your webapp is just
going to have to tolerate.

Perhaps you could add a parameter to all your requests like 'last=true'
and always make that the last parameter submitted. If the last parameter
has the value "true" then the POST was sane. Otherwise, reject the
request. Just a thought.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message