users@glassfish.java.net

Re: I want to test Max Post Size and want to see "Post too large" related exception/error

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Mon, 04 Apr 2011 16:12:34 +0200

Hi,

can you pls. send us HTTP request headers, which are getting sent to GF
when uploading files?

> Please let me know how can i test "Max Post Size"? What will be its
> affect?
> Is there any relation between Max Post Size and size of file being
> uploaded?
It's applied for posts with content-type
"application/x-www-form-urlencoded", which don't use chunked
transfer-encoding (use content-length).

> What are the difference between following properties:
>
> Timeout:
> Connection Upload Timeout:
This is used (if upload-timeout-enabled == true), to set max timeout
allowed when reading next chunk of uploaded data. This prevents server
from waiting too long for the next data chunk.

> Request Timeout:
This is used to limit time occupied by the single request processing.
Unlike the connection-upload-timeout, this timeout will be applied even
though client is actively sending data.

> Best way to test all these properties?
1) For upload-timeout-enabled, write a servlet which is saving client
post to the file.
On the client side send just part of data and then sleep... you should
see upload timeout occurred on the server.

2) For the request-timeout, call object.wait or thread.sleep with bigger
(let's say 1 year) parameter in the servlet code.
It will be interrupted after request-timeout expired.

WBR,
Alexey.