Mercurial > hg > ngx_http_upstream_keepalive
changeset 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 | 142c6443d851 |
files | t/fastcgi-keepalive.t |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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));