# HG changeset patch # User Maxim Dounin # Date 1240450383 -14400 # Node ID 28f8824141886652022b353106d07a2eb6f1682e # Parent 4fe7e417c42473bdbaa8bf507923eadc7ef038dd 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 diff --git a/t/fastcgi-keepalive.t b/t/fastcgi-keepalive.t --- a/t/fastcgi-keepalive.t +++ b/t/fastcgi-keepalive.t @@ -117,7 +117,18 @@ sub fastcgi_respond($$) { length($body), 0)); $h->{socket}->write($body); + # write some text to stdout and stderr splitted over multiple network + # packets to test if we correctly set pipe length in various places + + my $tt = "test text, just for test"; + + $h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id}, + length($tt . $tt), 0) . $tt); select(undef, undef, undef, 0.1); + $h->{socket}->write($tt . pack("CC", $h->{version}, 7)); + select(undef, undef, undef, 0.1); + $h->{socket}->write(pack("nnCx", $h->{id}, length($tt), 0)); + $h->{socket}->write($tt); # close stdout $h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id}, 0, 0));