Apache bug with POST method requests > ~4K

Apache bug with POST method requests > ~4K

Post by Charles Randolph Bowma » Fri, 12 Feb 1999 04:00:00



POST method requests larger than about 4K are not being handled properly
by CGI scripts with Apache 1.3.4 on my Linux (RedHat 5.2).  They work
fine with Apache 1.3.3 on the Unix at my ISP.

I am using the cgi module with only http_core and mod_so compiled in.

I have recompiled Apache_1.3.4 with SSLeay-0.9.0b, mod_ssl-2.2.2-1.3.4,
and rsaref-2.0 only to get the same result as I did with the Apache
1.3.3 that comes with RedHat Secure Web Server.

For testing, I have used this simple script under Perl 5.00405:

    #!/usr/local/bin/perl

    print "Content-type: text/plain\n\n";
    print while (<>);
    exit 0;

and the form:

    <FORM ENCTYPE="multipart/form-data" ACTION="cgi-bin/script.pl"
METHOD="POST">
    <INPUT TYPE="file" NAME="textfile" size=30>
    <P>
    <INPUT TYPE="submit" VALUE="Send File">
    <INPUT TYPE="reset" VALUE="Reset">
    </FORM>

Request smaller than ~4K work fine.

I have checked tcpdump, and everything has been sent by the client
properly (both Netscape and IE).

I suspect that this size limit has something to do with DEFAULT_BUFSIZ
defined in buff.c to be 4096.

Charles R. Bowman

 
 
 

Apache bug with POST method requests > ~4K

Post by Ilia Permino » Fri, 12 Feb 1999 04:00:00


Hi,

Apache (mod_cgi) does not read script output until all POST
args are passed to the script. Your script and Apache are
waiting each other. To avoid this deadlock read all POST args before
writing output.

Ilia

 
 
 

Apache bug with POST method requests > ~4K

Post by Charles Randolph Bowma » Fri, 12 Feb 1999 04:00:00


Yes, thank you!!

I replaced the print while loop with the line:

    foreach (<>) {print;}

and it worked!

Wonder why the Unix at my ISP did not have the same deadlock problem...

Thank you, Ilia.


> Hi,

> Apache (mod_cgi) does not read script output until all POST
> args are passed to the script. Your script and Apache are
> waiting each other. To avoid this deadlock read all POST args before
> writing output.

> Ilia

 
 
 

Apache bug with POST method requests > ~4K

Post by Nick K » Sat, 13 Feb 1999 04:00:00


Quote:> For testing, I have used this simple script under Perl 5.00405:

>     #!/usr/local/bin/perl

>     print "Content-type: text/plain\n\n";
>     print while (<>);
>     exit 0;

Bug 1: neither HTTP nor CGI gives you an EOF.  So the above may randomly
(appear to) work or fail.

Use CONTENT_LENGTH.

Quote:> Request smaller than ~4K work fine.

... by coincidence.

--
Nick Kew

 
 
 

1. apache 1.2b8 and request method "POST"

hi apachees out there

i'm quite new with the apache-httpd and trying to make some new pages :/
everything works fine, but i have one major problem and didnt get any hint
until now from the manual or the faq's:

my cgi-script with method=post produces allways something like in the env.:
CONTENT_LENGTH=19  (or some other number, depending of my inputs)
QUERY_STRING=      (this works with request_method=get, but never with post
until now)

i get:
QUERY_STRING=server.x=42&server.y=51 (or something similar, depending on my
inputs)
whith the same files, only by changing the method from POST to GET)

how can this happen??
whats wrong with my setup??

does anyone have a clue for this????
-------------------
Kamil Ince
from cologne in germany
offering free koelsch for useful hints ;)

2. statically linked ls binary

3. apache - The requested method POST is not allowed for the URL /main.cgi

4. Adding a new Disk

5. Apache error: The requested method POST is not allowed

6. Rage128 support for Solaris/SPARC ?

7. Request POST method in Apache 1.0.3

8. psuedo-tty disable with too many tries?

9. Apache Problem: Method POST Method Not Implemented

10. <Q> POST request method

11. The requested method POST is not allowed

12. The requested method POST is not allowed for the URL /net/formulaire.html