comparison t/fastcgi-keepalive.t @ 16:28f882414188 0.2

Keepalive: better fastcgi testing. With previous fastcgi keepalive patches minimal number of bytes that should be fed to input filter (pipe->length) wasn't always set correctly. Try harder to catch this. Reported by: Denis F. Latypoff
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 23 Apr 2009 05:33:03 +0400
parents 4fe7e417c424
children 8d8eaaf07663
comparison
equal deleted inserted replaced
15:4fe7e417c424 16:28f882414188
115 # stdout 115 # stdout
116 $h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id}, 116 $h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id},
117 length($body), 0)); 117 length($body), 0));
118 $h->{socket}->write($body); 118 $h->{socket}->write($body);
119 119
120 # write some text to stdout and stderr splitted over multiple network
121 # packets to test if we correctly set pipe length in various places
122
123 my $tt = "test text, just for test";
124
125 $h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id},
126 length($tt . $tt), 0) . $tt);
120 select(undef, undef, undef, 0.1); 127 select(undef, undef, undef, 0.1);
128 $h->{socket}->write($tt . pack("CC", $h->{version}, 7));
129 select(undef, undef, undef, 0.1);
130 $h->{socket}->write(pack("nnCx", $h->{id}, length($tt), 0));
131 $h->{socket}->write($tt);
121 132
122 # close stdout 133 # close stdout
123 $h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id}, 0, 0)); 134 $h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id}, 0, 0));
124 135
125 select(undef, undef, undef, 0.1); 136 select(undef, undef, undef, 0.1);