in reply to getting sometimes empty cgi form with post

Don't know what the problem is... so just two suggestions that might help to narrow down on the issue:

Those tests might help to figure out whether it's maybe an obscure bug with the CGI module (not entirely impossible), or if it's that the socket (or the pipe from apache to the CGI process) is being closed prematurely for whatever reason, or some such.

Replies are listed 'Best First'.
Re^2: getting sometimes empty cgi form with post
by david2008 (Scribe) on Mar 08, 2010 at 08:49 UTC
    Hi Almut, Thanks for your reply.
    It really helped me a lot.

    What is interesting that when the problem occurs i read 0 bytes and when i switched to cgi::simple it gave the following error with the cgi_error function. "500 Bad read on POST! wanted 135, got 0 at ...".

    Now i have just to find out why this happens :-).
    Thanks, David
      Now i have just to find out why this happens

      You could try strace (facetiously aka "Almut's Golden Hammer" at the place I work... — yes, I do tend to slightly overuse it, but it has definitely helped me numerous times to solve problems within minutes, that other people before had messed around with for hours or days ;)

      This might help to debug how/if the query string is handled apache-internally, and where exactly the error occurs that leads to it being dropped. At least if the problem is replicable enough that you won't have to wait thousands of requests for it to occur. To ease debugging, you might want to start up apache in single process mode (option -X). Also, don't forget to trace forked processes (the CGI script) as well (option -f).

        Thanks.
        I found an interesting issue that when changing the method to get, the problem nearly disappears.
        Maybe this fact could help to narrow down the problem.
        Thanks.

        I tried wireshark already and also httpfox on the client side. I see the request going out from the client. The problem is the server