https://issues.apache.org/bugzilla/show_bug.cgi?id=44782

           Summary: (104)Connection reset by peer: ap_content_length_filter:
                    apr_bucket_read() failed
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: All
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: [EMAIL PROTECTED]


After months of trying to figure out what triggers this error:

[Tue Apr 08 18:48:41 2008] [error] [client 123.456.789.012] (104)Connection
reset by peer: ap_content_length_filter: apr_bucket_read() failed, referer:
http://www.anydomain.com/someform.html

I finally found how to duplicate this on any Apache server. I've found this to
be true with all versions from 2.2.4 (earliest 2.x version I have) to 2.2.8
(latest).

Linux CentOS (2.6.18-53.1.14.el5) completely up-to-date. Apache compiled from
source. Using mod_perl compiled like this:

shell> perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/usr/local/src/httpd-2.2.8 \
MP_AP_CONFIGURE="--with-mpm=worker \
--enable-nonportable-atomics=yes \
--prefix=/usr/local/etc/httpd \
--enable-so \
--enable-expires \
--enable-headers \
--enable-rewrite \
--with-ssl=/usr/local/src/openssl-0.9.8g \
--enable-ssl \
--disable-autoindex \
--disable-userdir"

All it takes to produce the above error with Apache is to send a post to a cgi
script that does not handle the post data. Example program (test.cgi - not
running in mod_perl):

<--snip-->
#!/usr/bin/perl -w
$| = 1;

print "Content-type: text/html\n\n";
print <<"end_of_html";
<html>
<head>
<title>your title</title>
</head>
<body>
anything
</body>
</html>
end_of_html

exit();
<--snip-->

Now setup a simple HTML form and post to the above program:

<--snip-->
<html>
<head>
<title>your title</title>
</head>
<body>
<form action="/cgi-bin/test.cgi" method="post">
<input type="submit" name="test" value="Test It">
</form>
</body>
</html>
<--snip-->

(notice the "name='test'" as some data is required.) The above will cause the
browser to hang after post triggering the browser to disconnect from the server
and will always produce the above error guaranteed! Change from POST to GET and
no "Connection reset by peer" error. The test.cgi script will exit properly,
but Apache keeps the connection alive and then the browser disconnects.

I have tested this with Linux Firefox/1.5.0.12 - 2.0.0.13, Opera 9.26 as well
as on Windows XP Professional with Firefox/2.0.0.13 and IE 7.0.5730.11.

Note: If you add this to the top of the test.cgi program:

read(STDIN, my $buffer, $ENV{'CONTENT_LENGTH'});

No disconnect is encountered.

I believe this to be an Apache problem as all earlier versions of Apache did
not behave in this manner.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to