httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r609551 - in /httpd/test/trunk/perl-framework/t: htdocs/modules/cgi/ htdocs/modules/cgi/nph-dripfeed.pl.PL modules/proxy.t
Date Mon, 07 Jan 2008 10:20:29 GMT
Author: jorton
Date: Mon Jan  7 02:20:27 2008
New Revision: 609551

URL: http://svn.apache.org/viewvc?rev=609551&view=rev
Log:
- add test case which drip-feeds a chunked response byte by byte, to
exercise the non-blocking chunked response parser

Added:
    httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/nph-dripfeed.pl.PL
Modified:
    httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/   (props changed)
    httpd/test/trunk/perl-framework/t/modules/proxy.t

Propchange: httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jan  7 02:20:27 2008
@@ -16,3 +16,4 @@
 empty.pl
 pr37166.pl
 action.pl
+nph-dripfeed.pl

Added: httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/nph-dripfeed.pl.PL
URL: http://svn.apache.org/viewvc/httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/nph-dripfeed.pl.PL?rev=609551&view=auto
==============================================================================
--- httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/nph-dripfeed.pl.PL (added)
+++ httpd/test/trunk/perl-framework/t/htdocs/modules/cgi/nph-dripfeed.pl.PL Mon Jan  7 02:20:27
2008
@@ -0,0 +1,17 @@
+print "HTTP/1.0 200 OK\r\n";
+print "Transfer-Encoding: chunked\r\n";
+print "\r\n";
+
+$| = 1;
+
+sub dripfeed {
+    my $s = shift;
+
+    while (length($s)) {
+        select(undef, undef, undef, 0.2);
+        print substr($s, 0, 1);
+        $s = substr($s, 1);
+    }
+}
+
+dripfeed "0005\r\nabcde\r\n1; foo=bar\r\nf\r\n0\r\n\r\n";

Modified: httpd/test/trunk/perl-framework/t/modules/proxy.t
URL: http://svn.apache.org/viewvc/httpd/test/trunk/perl-framework/t/modules/proxy.t?rev=609551&r1=609550&r2=609551&view=diff
==============================================================================
--- httpd/test/trunk/perl-framework/t/modules/proxy.t (original)
+++ httpd/test/trunk/perl-framework/t/modules/proxy.t Mon Jan  7 02:20:27 2008
@@ -6,7 +6,7 @@
 use Apache::TestUtil;
 use Apache::TestConfig ();
 
-plan tests => 13, need_module 'proxy';
+plan tests => 15, need_module 'proxy';
 
 Apache::TestRequest::module("proxy_http_reverse");
 Apache::TestRequest::user_agent(requests_redirectable => 0);
@@ -24,6 +24,10 @@
     ok t_cmp($r->code, 200, "reverse proxy with query string");
     ok t_cmp($r->content, qr/QUERY_STRING = reverse-proxy\n/s, "reverse proxied query
string OK");
 
+    $r = GET("/reverse/modules/cgi/nph-dripfeed.pl");
+    ok t_cmp($r->code, 200, "reverse proxy to dripfeed CGI");
+    ok t_cmp($r->content, "abcdef", "reverse proxied to dripfeed CGI content OK");
+
     if (have_min_apache_version('2.1.0')) {
         $r = GET("/reverse/modules/cgi/nph-102.pl");
         ok t_cmp($r->code, 200, "reverse proxy to nph-102");
@@ -32,7 +36,7 @@
         skip "skipping tests with httpd <2.1.0" foreach (1..2);
     }
 } else {
-    skip "skipping tests without CGI module" foreach (1..6);
+    skip "skipping tests without CGI module" foreach (1..8);
 }
 
 if (have_min_apache_version('2.0.55')) {



Mime
View raw message