hi all t/apache/limits.t has one failure on Apache 1.3 - a chunked body that exceeds the limits. 2.0/2.1 returns 413 (entity too large) while 1.3 returns 400 (bad request).
after looking at the code in 1.3 I think this is intentional - ap_get_client_block specifically handles this condition, while the 2.0 tree seems to handle it elsewhere. furthermore, it seems people were aware of this at the time (over 2 years ago) - the comments from version 1.4 are Whew! Now tests upload chunking properly -- but Apache 1.3 may be responding with a 400 when it should be a 413. Many thanks to Doug MacEachern and Gisle Aas for their help with getting the HTTP/1.1 chunking stuff working. so, at this point I'm convinced that 1.3 and 2.0 geniunely differ in this respect. so, assuming that this is a legacy behavior in 1.3 that will probably never be addressed, here is a patch to set 1.3 expectations. if there are feelings that it should be marked as TODO, please let me know. --Geoff
Index: t/apache/limits.t =================================================================== RCS file: /home/cvspublic/httpd-test/perl-framework/t/apache/limits.t,v retrieving revision 1.12 diff -u -r1.12 limits.t --- t/apache/limits.t 9 May 2002 07:14:36 -0000 1.12 +++ t/apache/limits.t 10 Dec 2003 19:24:30 -0000 @@ -59,11 +59,13 @@ my $subtests = (@conditions * 2) + 2; plan tests => $subtests, \&have_lwp; +use vars qw($expected_rc); + my $testnum = 1; foreach my $cond (@conditions) { foreach my $goodbad (qw(succeed fail)) { my $param = $params{"$cond-$goodbad"}; - my $expected_rc = $xrcs{"$cond-$goodbad"}; + $expected_rc = $xrcs{"$cond-$goodbad"}; my $resp; if ($cond eq 'fieldcount') { my %fields; @@ -109,6 +111,14 @@ $req->header('X-Subtest' => $testnum); $req->content(chunk_it($param)); $resp = Apache::TestRequest::user_agent->request($req); + + # limit errors with chunked request bodies get + # 400 with 1.3, not 413 - see special chunked + # request handling in ap_get_client_block in 1.3 + + local $expected_rc = 400 if $goodbad eq 'fail' && + have_apache(1); + ok t_cmp($expected_rc, $resp->code, "Test #$testnum");