diff options
author | Stefan Bühler <stbuehler@web.de> | 2009-04-03 22:41:02 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2009-04-03 22:41:02 +0000 |
commit | b8b4fe19c8ebc80d91ffbebcb7d37f5180b1ecbe (patch) | |
tree | 1ed798eb190e0fc6e160e4d0d468a3d31cc8e429 /tests/LightyTest.pm | |
parent | ce39062dd260960e927be6344a71eca4b0bef314 (diff) | |
download | lighttpd-git-b8b4fe19c8ebc80d91ffbebcb7d37f5180b1ecbe.tar.gz |
Finally removed spawn-fcgi
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2423 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/LightyTest.pm')
-rwxr-xr-x | tests/LightyTest.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm index 8d814dec..84f246cf 100755 --- a/tests/LightyTest.pm +++ b/tests/LightyTest.pm @@ -6,7 +6,8 @@ use IO::Socket; use Test::More; use Socket; use Cwd 'abs_path'; -use POSIX ":sys_wait_h"; +use POSIX qw(:sys_wait_h dup2); +use Errno qw(EADDRINUSE); sub mtime { my $file = shift; @@ -344,8 +345,14 @@ sub spawnfcgi { return -1; } if ($child == 0) { - my $cmd = $self->{BINDIR}.'/spawn-fcgi -n -p '.$port.' -f "'.$binary.'"'; - exec $cmd or die($?); + my $iaddr = inet_aton('localhost') || die "no host: localhost"; + my $proto = getprotobyname('tcp'); + socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!"; + setsockopt(SOCK, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!"; + bind(SOCK, sockaddr_in($port, $iaddr)) || die "bind: $!"; + listen(SOCK, 1024) || die "listen: $!"; + dup2(fileno(SOCK), 0) || die "dup2: $!"; + exec $binary or die($?); } else { if (0 != $self->wait_for_port_with_proc($port, $child)) { diag(sprintf('The process %i is not up (port %i, %s)', $child, $port, $binary)); |