Loading tests/runtests.pl +26 −8 Original line number Original line Diff line number Diff line Loading @@ -661,14 +661,20 @@ sub verifyftp { sub verifyssh { sub verifyssh { my ($proto, $ip, $port) = @_; my ($proto, $ip, $port) = @_; my $pid; my $pid = 0; if(open(FILE, "<$SSHPIDFILE")) { if(open(FILE, "<$SSHPIDFILE")) { $pid=0+<FILE>; $pid=0+<FILE>; close(FILE); close(FILE); logmsg "TRACESSH:verifyssh: pid from $SSHPIDFILE is $pid\n"; } } else { if($pid > 0) { logmsg "TRACESSH:verifyssh: cannot open file $SSHPIDFILE\n"; # if we have a pid it is actually our ssh server, # since runsshserver() unlinks previous pidfile if(!kill(0, $pid) { logmsg "RUN: SSH server has died after starting up\n"; checkdied($pid) unlink($SSHPIDFILE); $pid = -1; } } } return $pid; return $pid; } } Loading @@ -678,9 +684,21 @@ sub verifyssh { sub verifysocks { sub verifysocks { my ($proto, $ip, $port) = @_; my ($proto, $ip, $port) = @_; open(FILE, "<$SOCKSPIDFILE"); my $pid = 0; my $pid=0+<FILE>; if(open(FILE, "<$SOCKSPIDFILE")) { $pid=0+<FILE>; close(FILE); close(FILE); } if($pid > 0) { # if we have a pid it is actually our socks server, # since runsocksserver() unlinks previous pidfile if(!kill(0, $pid) { logmsg "RUN: SOCKS server has died after starting up\n"; checkdied($pid) unlink($SOCKSPIDFILE); $pid = -1; } } return $pid; return $pid; } } Loading Loading @@ -2500,7 +2518,7 @@ sub startservers { } } if($what eq "socks4" || $what eq "socks5") { if($what eq "socks4" || $what eq "socks5") { if(!$run{'socks'}) { if(!$run{'socks'}) { ($pid, $pid2) = runsocksserver("", 1); ($pid, $pid2) = runsocksserver("", $verbose); if($pid <= 0) { if($pid <= 0) { return "failed starting socks server"; return "failed starting socks server"; } } Loading Loading
tests/runtests.pl +26 −8 Original line number Original line Diff line number Diff line Loading @@ -661,14 +661,20 @@ sub verifyftp { sub verifyssh { sub verifyssh { my ($proto, $ip, $port) = @_; my ($proto, $ip, $port) = @_; my $pid; my $pid = 0; if(open(FILE, "<$SSHPIDFILE")) { if(open(FILE, "<$SSHPIDFILE")) { $pid=0+<FILE>; $pid=0+<FILE>; close(FILE); close(FILE); logmsg "TRACESSH:verifyssh: pid from $SSHPIDFILE is $pid\n"; } } else { if($pid > 0) { logmsg "TRACESSH:verifyssh: cannot open file $SSHPIDFILE\n"; # if we have a pid it is actually our ssh server, # since runsshserver() unlinks previous pidfile if(!kill(0, $pid) { logmsg "RUN: SSH server has died after starting up\n"; checkdied($pid) unlink($SSHPIDFILE); $pid = -1; } } } return $pid; return $pid; } } Loading @@ -678,9 +684,21 @@ sub verifyssh { sub verifysocks { sub verifysocks { my ($proto, $ip, $port) = @_; my ($proto, $ip, $port) = @_; open(FILE, "<$SOCKSPIDFILE"); my $pid = 0; my $pid=0+<FILE>; if(open(FILE, "<$SOCKSPIDFILE")) { $pid=0+<FILE>; close(FILE); close(FILE); } if($pid > 0) { # if we have a pid it is actually our socks server, # since runsocksserver() unlinks previous pidfile if(!kill(0, $pid) { logmsg "RUN: SOCKS server has died after starting up\n"; checkdied($pid) unlink($SOCKSPIDFILE); $pid = -1; } } return $pid; return $pid; } } Loading Loading @@ -2500,7 +2518,7 @@ sub startservers { } } if($what eq "socks4" || $what eq "socks5") { if($what eq "socks4" || $what eq "socks5") { if(!$run{'socks'}) { if(!$run{'socks'}) { ($pid, $pid2) = runsocksserver("", 1); ($pid, $pid2) = runsocksserver("", $verbose); if($pid <= 0) { if($pid <= 0) { return "failed starting socks server"; return "failed starting socks server"; } } Loading