Skip to content

Commit 5c9ccb3

Browse files
committed
Tests: avoid uninitialized warnings in fastcgi tests.
1 parent 60ec29f commit 5c9ccb3

4 files changed

+8
-8
lines changed

fastcgi_body2.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ sub fastcgi_daemon {
114114
$socket);
115115

116116
while( $request->Accept() >= 0 ) {
117-
read(STDIN, my $body, $ENV{'CONTENT_LENGTH'});
117+
read(STDIN, my $body, $ENV{'CONTENT_LENGTH'} || 0);
118118
my $len = length $body;
119119

120120
sleep 3 if $port == port(8081);

fastcgi_merge_params.t

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ sub fastcgi_daemon {
120120
while( $request->Accept() >= 0 ) {
121121
$count++;
122122

123-
my $ims = $ENV{HTTP_IF_MODIFIED_SINCE};
124-
my $iums = $ENV{HTTP_IF_UNMODIFIED_SINCE};
125-
my $blah = $ENV{HTTP_X_BLAH};
123+
my $ims = $ENV{HTTP_IF_MODIFIED_SINCE} || '';
124+
my $iums = $ENV{HTTP_IF_UNMODIFIED_SINCE} || '';
125+
my $blah = $ENV{HTTP_X_BLAH} || '';
126126

127127
print <<EOF;
128128
Location: http://localhost/redirect

fastcgi_merge_params2.t

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ sub fastcgi_daemon {
104104
while( $request->Accept() >= 0 ) {
105105
$count++;
106106

107-
my $ims = $ENV{HTTP_IF_MODIFIED_SINCE};
108-
my $iums = $ENV{HTTP_IF_UNMODIFIED_SINCE};
109-
my $blah = $ENV{HTTP_X_BLAH};
107+
my $ims = $ENV{HTTP_IF_MODIFIED_SINCE} || '';
108+
my $iums = $ENV{HTTP_IF_UNMODIFIED_SINCE} || '';
109+
my $blah = $ENV{HTTP_X_BLAH} || '';
110110

111111
print <<EOF;
112112
Location: http://localhost/redirect

fastcgi_request_buffering.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ sub fastcgi_daemon {
350350

351351
while( $request->Accept() >= 0 ) {
352352
$count++;
353-
read(STDIN, $body, $ENV{'CONTENT_LENGTH'});
353+
read(STDIN, $body, $ENV{'CONTENT_LENGTH'} || 0);
354354

355355
if ($ENV{REQUEST_URI} eq '/error_page') {
356356
print "Status: 404 Not Found" . CRLF . CRLF;

0 commit comments

Comments
 (0)