gbenson 01/11/06 08:03:00
Modified: perl-framework/c-modules/random_chunk mod_random_chunk.c
perl-framework/t/http11 chunked.t
Log:
Fix for Apache 1.3
Revision Changes Path
1.6 +3 -2
httpd-test/perl-framework/c-modules/random_chunk/mod_random_chunk.c
Index: mod_random_chunk.c
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/c-modules/random_chunk/mod_random_chunk.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- mod_random_chunk.c 2001/09/08 22:07:14 1.5
+++ mod_random_chunk.c 2001/11/06 16:03:00 1.6
@@ -1,5 +1,3 @@
-#define HTTPD_TEST_REQUIRE_APACHE 2
-
#if CONFIG_FOR_HTTPD_TEST
<Location /random_chunk>
@@ -126,6 +124,9 @@
r->content_type = "text/html";
+#ifdef APACHE1
+ ap_send_http_header(r);
+#endif
if (r->header_only) {
return OK;
}
1.11 +18 -4 httpd-test/perl-framework/t/http11/chunked.t
Index: chunked.t
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/http11/chunked.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- chunked.t 2001/11/01 21:45:57 1.10
+++ chunked.t 2001/11/06 16:03:00 1.11
@@ -9,8 +9,8 @@
Apache::TestRequest::scheme('http')
unless have_module 'LWP::Protocol::https10'; #lwp 5.60
-#chunked encoding is optional and will only be used if
-#response is > 4*AP_MIN_BYTES_TO_WRITE (see server/protocol.c)
+#In httpd-2.0, chunked encoding is optional and will only be used
+#if response is > 4*AP_MIN_BYTES_TO_WRITE (see server/protocol.c)
my @small_sizes = (100, 5000);
my @chunk_sizes = (25432, 75962, 100_000, 300_000);
@@ -22,7 +22,8 @@
my $location = '/random_chunk';
my $requests = 0;
-for my $size (@chunk_sizes) {
+sub expect_chunked {
+ my $size = shift;
sok sub {
my $res = GET "/random_chunk?0,$size";
my $body = $res->content;
@@ -47,7 +48,8 @@
}, 5;
}
-for my $size (@small_sizes) {
+sub expect_not_chunked {
+ my $size = shift;
sok sub {
my $res = GET "/random_chunk?0,$size";
my $body = $res->content;
@@ -75,3 +77,15 @@
}, 5;
}
+for my $size (@chunk_sizes) {
+ expect_chunked $size;
+}
+
+for my $size (@small_sizes) {
+ if (have_apache 1) {
+ expect_chunked $size;
+ }
+ else {
+ expect_not_chunked $size;
+ }
+}