Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(927)

Side by Side Diff: LayoutTests/http/tests/resources/post-and-verify.cgi

Issue 155173003: checkpoint unix version of apache win32 patch. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: re-daemonize apache on unix Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/perl -w 1 #!/usr/bin/perl -wT
2 2
3 print "Content-type: text/plain\n\n"; 3 print "Content-type: text/plain\n\n";
4 4
5 if ($ENV{'REQUEST_METHOD'} eq "POST") { 5 if ($ENV{'REQUEST_METHOD'} eq "POST") {
6 if ($ENV{'CONTENT_LENGTH'}) { 6 if ($ENV{'CONTENT_LENGTH'}) {
7 read(STDIN, $postData, $ENV{'CONTENT_LENGTH'}) || die "Could not get pos t data\n"; 7 read(STDIN, $postData, $ENV{'CONTENT_LENGTH'}) || die "Could not get pos t data\n";
8 } else { 8 } else {
9 $postData = ""; 9 $postData = "";
10 } 10 }
11 11
12 @list = split(/&/, $ENV{'QUERY_STRING'}); 12 @list = split(/&/, $ENV{'QUERY_STRING'});
13 foreach $element (@list) { 13 foreach $element (@list) {
14 ($key, $value) = split(/=/, $element); 14 ($key, $value) = split(/=/, $element);
15 $values{$key} = $value; 15 $values{$key} = $value;
16 } 16 }
17 17
18 open FILE, $values{'path'} || die("Could not open file\n"); 18 open FILE, $values{'path'} || die("Could not open file\n");
19 seek FILE, $values{'start'}, 0; 19 seek FILE, $values{'start'}, 0;
20 read FILE, $expectedData, $values{'length'}; 20 read FILE, $expectedData, $values{'length'};
21 close(FILE); 21 close(FILE);
22 22
23 if ($postData eq $expectedData) { 23 if ($postData eq $expectedData) {
24 print "OK"; 24 print "OK";
25 } else { 25 } else {
26 print "FAILED"; 26 print "FAILED";
27 } 27 }
28 } else { 28 } else {
29 print "Wrong method: " . $ENV{'REQUEST_METHOD'} . "\n"; 29 print "Wrong method: " . $ENV{'REQUEST_METHOD'} . "\n";
30 } 30 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/resources/load-and-stall.cgi ('k') | LayoutTests/http/tests/resources/post-and-verify-hybrid.cgi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698