From 8c83976dbefffaa82ed3cddbee6336f3eb1a60c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Wed, 14 Oct 2009 17:32:38 +0000 Subject: mod_fastcgi: Add "X-Sendfile2" - supporting multiple ranged files (fixes #2008) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2651 152afb58-edef-0310-8abb-c4023f1b3aa9 --- tests/docroot/www/Makefile.am | 2 +- tests/docroot/www/sendfile.php | 13 +++++++++++++ tests/lighttpd.conf | 2 +- tests/mod-fastcgi.t | 18 ++++++++++++++++-- 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 tests/docroot/www/sendfile.php (limited to 'tests') diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am index f535cb25..5bc0c0b3 100644 --- a/tests/docroot/www/Makefile.am +++ b/tests/docroot/www/Makefile.am @@ -1,5 +1,5 @@ EXTRA_DIST=cgi.php cgi.pl index.html index.txt phpinfo.php \ redirect.php cgi-pathinfo.pl get-env.php get-server-env.php \ nph-status.pl prefix.fcgi get-header.pl ssi.shtml get-post-len.pl \ - exec-date.shtml 404.fcgi 404.html 404.pl send404.pl crlfcrash.pl + exec-date.shtml 404.fcgi 404.html 404.pl send404.pl crlfcrash.pl sendfile.php SUBDIRS=go indexfile expire diff --git a/tests/docroot/www/sendfile.php b/tests/docroot/www/sendfile.php new file mode 100644 index 00000000..0aa8786f --- /dev/null +++ b/tests/docroot/www/sendfile.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/tests/lighttpd.conf b/tests/lighttpd.conf index 2202100f..f93311d0 100644 --- a/tests/lighttpd.conf +++ b/tests/lighttpd.conf @@ -83,7 +83,7 @@ $HTTP["url"] =~ "\.pdf$" { } fastcgi.debug = 0 -fastcgi.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 1026, "broken-scriptfilename" => "enable" ) ), +fastcgi.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 1026, "broken-scriptfilename" => "enable", "allow-x-send-file" => "enable" ) ), "/prefix.fcgi" => ( ( "host" => "127.0.0.1", "port" => 1026, "check-local" => "disable", "broken-scriptfilename" => "enable" ) ) ) diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t index 63c7b152..64cf63da 100755 --- a/tests/mod-fastcgi.t +++ b/tests/mod-fastcgi.t @@ -7,7 +7,7 @@ BEGIN { } use strict; -use Test::More tests => 54; +use Test::More tests => 56; use LightyTest; my $tf = LightyTest->new(); @@ -25,7 +25,7 @@ SKIP: { } SKIP: { - skip "no PHP running on port 1026", 31 unless $tf->listening_on(1026); + skip "no PHP running on port 1026", 33 unless $tf->listening_on(1026); ok($tf->start_proc == 0, "Starting lighttpd") or goto cleanup; @@ -174,6 +174,20 @@ EOF $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo/bar' } ]; ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off'); + $t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => 4348 } ]; + ok($tf->handle_http($t) == 0, 'X-Sendfile2'); + + $t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => 4348 } ]; + ok($tf->handle_http($t) == 0, 'X-Sendfile2'); + ok($tf->stop_proc == 0, "Stopping lighttpd"); -- cgit v1.2.1