mirror of
https://github.com/curl/curl.git
synced 2025-01-30 14:22:33 +08:00
runtests: minor code cleanups
This commit is contained in:
parent
62ba1d6bd9
commit
ec2a5bc5fc
@ -433,7 +433,7 @@ sub checkdied {
|
||||
# Return the pids (yes plural) of the new child process to the parent.
|
||||
#
|
||||
sub startnew {
|
||||
my ($cmd, $pidfile, $timeout, $fake)=@_;
|
||||
my ($cmd, $pidfile, $timeout, $fakepidfile)=@_;
|
||||
|
||||
logmsg "startnew: $cmd\n" if ($verbose);
|
||||
|
||||
@ -460,7 +460,7 @@ sub startnew {
|
||||
}
|
||||
|
||||
# Ugly hack but ssh client and gnutls-serv don't support pid files
|
||||
if ($fake) {
|
||||
if ($fakepidfile) {
|
||||
if(open(my $out, ">", "$pidfile")) {
|
||||
print $out $child . "\n";
|
||||
close($out) || die "Failure writing pidfile";
|
||||
@ -839,7 +839,6 @@ sub getexternalproxyflags {
|
||||
sub verifyhttp {
|
||||
my ($proto, $ipvnum, $idnum, $ip, $port_or_path) = @_;
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pid = 0;
|
||||
my $bonus="";
|
||||
# $port_or_path contains a path for Unix sockets, sws ignores the port
|
||||
my $port = ($ipvnum eq "unix") ? 80 : $port_or_path;
|
||||
@ -900,6 +899,7 @@ sub verifyhttp {
|
||||
close($file);
|
||||
}
|
||||
|
||||
my $pid = 0;
|
||||
if($data && ($data =~ /WE ROOLZ: (\d+)/)) {
|
||||
$pid = 0+$1;
|
||||
}
|
||||
@ -924,7 +924,6 @@ sub verifyhttp {
|
||||
sub verifyftp {
|
||||
my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pid = 0;
|
||||
my $time=time();
|
||||
my $extra="";
|
||||
|
||||
@ -958,6 +957,7 @@ sub verifyftp {
|
||||
return -1;
|
||||
}
|
||||
|
||||
my $pid = 0;
|
||||
foreach my $line (@data) {
|
||||
if($line =~ /WE ROOLZ: (\d+)/) {
|
||||
# this is our test server with a known pid!
|
||||
@ -991,7 +991,6 @@ sub verifyftp {
|
||||
sub verifyrtsp {
|
||||
my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pid = 0;
|
||||
|
||||
my $verifyout = "$LOGDIR/".
|
||||
servername_canon($proto, $ipvnum, $idnum) .'_verify.out';
|
||||
@ -1043,6 +1042,7 @@ sub verifyrtsp {
|
||||
close($file);
|
||||
}
|
||||
|
||||
my $pid = 0;
|
||||
if($data && ($data =~ /RTSP_SERVER WE ROOLZ: (\d+)/)) {
|
||||
$pid = 0+$1;
|
||||
}
|
||||
@ -1065,7 +1065,6 @@ sub verifyrtsp {
|
||||
#
|
||||
sub verifyssh {
|
||||
my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pidfile = server_pidfilename($proto, $ipvnum, $idnum);
|
||||
my $pid = processexists($pidfile);
|
||||
if($pid < 0) {
|
||||
@ -1121,7 +1120,6 @@ sub verifyhttptls {
|
||||
my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pidfile = server_pidfilename($proto, $ipvnum, $idnum);
|
||||
my $pid = 0;
|
||||
|
||||
my $verifyout = "$LOGDIR/".
|
||||
servername_canon($proto, $ipvnum, $idnum) .'_verify.out';
|
||||
@ -1174,6 +1172,7 @@ sub verifyhttptls {
|
||||
close($file);
|
||||
}
|
||||
|
||||
my $pid = 0;
|
||||
if($data && ($data =~ /(GNUTLS|GnuTLS)/) && ($pid = processexists($pidfile))) {
|
||||
if($pid < 0) {
|
||||
logmsg "RUN: $server server has died after starting up\n";
|
||||
@ -1197,7 +1196,6 @@ sub verifyhttptls {
|
||||
#
|
||||
sub verifysocks {
|
||||
my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pidfile = server_pidfilename($proto, $ipvnum, $idnum);
|
||||
my $pid = processexists($pidfile);
|
||||
if($pid < 0) {
|
||||
@ -1215,7 +1213,6 @@ sub verifysocks {
|
||||
sub verifysmb {
|
||||
my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pid = 0;
|
||||
my $time=time();
|
||||
my $extra="";
|
||||
|
||||
@ -1243,6 +1240,7 @@ sub verifysmb {
|
||||
return -1;
|
||||
}
|
||||
|
||||
my $pid = 0;
|
||||
foreach my $line (@data) {
|
||||
if($line =~ /WE ROOLZ: (\d+)/) {
|
||||
# this is our test server with a known pid!
|
||||
@ -1276,7 +1274,6 @@ sub verifysmb {
|
||||
sub verifytelnet {
|
||||
my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pid = 0;
|
||||
my $time=time();
|
||||
my $extra="";
|
||||
|
||||
@ -1304,6 +1301,7 @@ sub verifytelnet {
|
||||
return -1;
|
||||
}
|
||||
|
||||
my $pid = 0;
|
||||
foreach my $line (@data) {
|
||||
if($line =~ /WE ROOLZ: (\d+)/) {
|
||||
# this is our test server with a known pid!
|
||||
@ -1411,20 +1409,15 @@ sub responsiveserver {
|
||||
#
|
||||
sub runhttp2server {
|
||||
my ($verb) = @_;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
my $proto="http/2";
|
||||
my $ipvnum = 4;
|
||||
my $idnum = 0;
|
||||
my $exe = "$perl $srcdir/http2-server.pl";
|
||||
my $verbose_flag = "--verbose ";
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -1437,10 +1430,10 @@ sub runhttp2server {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--nghttpx \"$ENV{'NGHTTPX'}\" ";
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--logdir \"$LOGDIR\" ";
|
||||
@ -1485,20 +1478,15 @@ sub runhttp2server {
|
||||
#
|
||||
sub runhttp3server {
|
||||
my ($verb, $cert) = @_;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
my $proto="http/3";
|
||||
my $ipvnum = 4;
|
||||
my $idnum = 0;
|
||||
my $exe = "$perl $srcdir/http3-server.pl";
|
||||
my $verbose_flag = "--verbose ";
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -1511,10 +1499,10 @@ sub runhttp3server {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--nghttpx \"$ENV{'NGHTTPX'}\" ";
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--logdir \"$LOGDIR\" ";
|
||||
@ -1559,11 +1547,6 @@ sub runhttpserver {
|
||||
my $ip = $HOSTIP;
|
||||
my $ipvnum = 4;
|
||||
my $idnum = 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
my $exe = "$perl $srcdir/http-server.pl";
|
||||
my $verbose_flag = "--verbose ";
|
||||
|
||||
@ -1581,10 +1564,9 @@ sub runhttpserver {
|
||||
$ipvnum = "unix";
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $portfile = $serverportfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -1597,10 +1579,12 @@ sub runhttpserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $portfile = $serverportfile{$server};
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--gopher " if($proto eq "gopher");
|
||||
$flags .= "--connect $HOSTIP " if($alt eq "proxy");
|
||||
$flags .= $verbose_flag if($debugprotocol);
|
||||
@ -1661,11 +1645,6 @@ sub runhttpsserver {
|
||||
my $ip = $HOSTIP;
|
||||
my $ipvnum = 4;
|
||||
my $idnum = 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
if($proxy eq "proxy") {
|
||||
# the https-proxy runs as https2
|
||||
@ -1676,9 +1655,9 @@ sub runhttpsserver {
|
||||
return (0, 0, 0);
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -1691,12 +1670,11 @@ sub runhttpsserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
$certfile = 'stunnel.pem' unless($certfile);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose " if($debugprotocol);
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--logdir \"$LOGDIR\" ";
|
||||
@ -1754,19 +1732,14 @@ sub runhttptlsserver {
|
||||
my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
|
||||
my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
|
||||
my $idnum = 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
if(!$httptlssrv) {
|
||||
return (0,0);
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -1779,10 +1752,10 @@ sub runhttptlsserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--http ";
|
||||
$flags .= "--debug 1 " if($debugprotocol);
|
||||
$flags .= "--priority NORMAL:+SRP ";
|
||||
@ -1822,19 +1795,13 @@ sub runhttptlsserver {
|
||||
#
|
||||
sub runpingpongserver {
|
||||
my ($proto, $id, $verb, $ipv6) = @_;
|
||||
my $port;
|
||||
my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
|
||||
my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
|
||||
my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
my $portfile = $serverportfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
@ -1848,10 +1815,10 @@ sub runpingpongserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose " if($debugprotocol);
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--logdir \"$LOGDIR\" ";
|
||||
@ -1873,7 +1840,7 @@ sub runpingpongserver {
|
||||
}
|
||||
|
||||
# where is it?
|
||||
$port = pidfromfile($portfile);
|
||||
my $port = pidfromfile($portfile);
|
||||
|
||||
logmsg "PINGPONG runs on port $port ($portfile)\n" if($verb);
|
||||
|
||||
@ -1911,19 +1878,14 @@ sub runsecureserver {
|
||||
my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
|
||||
my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
|
||||
my $idnum = 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
if(!$stunnel) {
|
||||
return (0,0);
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -1936,12 +1898,11 @@ sub runsecureserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
$certfile = 'stunnel.pem' unless($certfile);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose " if($debugprotocol);
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--logdir \"$LOGDIR\" ";
|
||||
@ -1994,11 +1955,6 @@ sub runtftpserver {
|
||||
my $proto = 'tftp';
|
||||
my $ipvnum = 4;
|
||||
my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
if($ipv6) {
|
||||
# if IPv6, use a different setup
|
||||
@ -2006,10 +1962,9 @@ sub runtftpserver {
|
||||
$ip = $HOST6IP;
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $portfile = $serverportfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -2022,15 +1977,16 @@ sub runtftpserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $portfile = $serverportfile{$server};
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose " if($debugprotocol);
|
||||
$flags .= "--pidfile \"$pidfile\" ".
|
||||
"--portfile \"$portfile\" ".
|
||||
"--logfile \"$logfile\" ".
|
||||
"--logdir \"$LOGDIR\" ";
|
||||
$flags .= "--pidfile \"$pidfile\" ";
|
||||
$flags .= "--portfile \"$portfile\" ";
|
||||
$flags .= "--logfile \"$logfile\" ";
|
||||
$flags .= "--logdir \"$LOGDIR\" ";
|
||||
$flags .= "--id $idnum " if($idnum > 1);
|
||||
$flags .= "--ipv$ipvnum --port 0 --srcdir \"$srcdir\"";
|
||||
|
||||
@ -2077,11 +2033,6 @@ sub runrtspserver {
|
||||
my $proto = 'rtsp';
|
||||
my $ipvnum = 4;
|
||||
my $idnum = 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
if($ipv6) {
|
||||
# if IPv6, use a different setup
|
||||
@ -2089,9 +2040,9 @@ sub runrtspserver {
|
||||
$ip = $HOST6IP;
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
my $portfile = $serverportfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
@ -2105,15 +2056,15 @@ sub runrtspserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose " if($debugprotocol);
|
||||
$flags .= "--pidfile \"$pidfile\" ".
|
||||
"--portfile \"$portfile\" ".
|
||||
"--logfile \"$logfile\" ".
|
||||
"--logdir \"$LOGDIR\" ";
|
||||
$flags .= "--pidfile \"$pidfile\" ";
|
||||
$flags .= "--portfile \"$portfile\" ";
|
||||
$flags .= "--logfile \"$logfile\" ";
|
||||
$flags .= "--logdir \"$LOGDIR\" ";
|
||||
$flags .= "--id $idnum " if($idnum > 1);
|
||||
$flags .= "--ipv$ipvnum --port 0 --srcdir \"$srcdir\"";
|
||||
|
||||
@ -2160,10 +2111,6 @@ sub runsshserver {
|
||||
my $proto = 'ssh';
|
||||
my $ipvnum = 4;
|
||||
my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $port = 20000; # no lower port
|
||||
|
||||
if(!$USER) {
|
||||
@ -2171,9 +2118,9 @@ sub runsshserver {
|
||||
return (0,0,0);
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -2191,9 +2138,8 @@ sub runsshserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose " if($verb);
|
||||
@ -2306,16 +2252,10 @@ sub runmqttserver {
|
||||
my $port = protoport($proto);
|
||||
my $ipvnum = 4;
|
||||
my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $portfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
$pidfile = $serverpidfile{$server};
|
||||
$portfile = $serverportfile{$server};
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
my $portfile = $serverportfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -2328,9 +2268,8 @@ sub runmqttserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
# start our MQTT server - on a random port!
|
||||
my $cmd="server/mqttd".exe_ext('SRV').
|
||||
@ -2369,16 +2308,10 @@ sub runsocksserver {
|
||||
my $proto = 'socks';
|
||||
my $ipvnum = 4;
|
||||
my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $portfile = $serverportfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -2391,9 +2324,9 @@ sub runsocksserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $portfile = $serverportfile{$server};
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
# start our socks server, get commands from the FTP cmd file
|
||||
my $cmd="";
|
||||
@ -2443,19 +2376,14 @@ sub rundictserver {
|
||||
my $ip = $HOSTIP;
|
||||
my $ipvnum = 4;
|
||||
my $idnum = 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
if($alt eq "ipv6") {
|
||||
# No IPv6
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -2468,10 +2396,10 @@ sub rundictserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose 1 " if($debugprotocol);
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--id $idnum " if($idnum > 1);
|
||||
@ -2515,19 +2443,14 @@ sub runsmbserver {
|
||||
my $ip = $HOSTIP;
|
||||
my $ipvnum = 4;
|
||||
my $idnum = 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
if($alt eq "ipv6") {
|
||||
# No IPv6
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -2540,10 +2463,10 @@ sub runsmbserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose 1 " if($debugprotocol);
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--id $idnum " if($idnum > 1);
|
||||
@ -2587,19 +2510,14 @@ sub runnegtelnetserver {
|
||||
my $ip = $HOSTIP;
|
||||
my $ipvnum = 4;
|
||||
my $idnum = 1;
|
||||
my $server;
|
||||
my $srvrname;
|
||||
my $pidfile;
|
||||
my $logfile;
|
||||
my $flags = "";
|
||||
|
||||
if($alt eq "ipv6") {
|
||||
# No IPv6
|
||||
}
|
||||
|
||||
$server = servername_id($proto, $ipvnum, $idnum);
|
||||
my $server = servername_id($proto, $ipvnum, $idnum);
|
||||
|
||||
$pidfile = $serverpidfile{$server};
|
||||
my $pidfile = $serverpidfile{$server};
|
||||
|
||||
# don't retry if the server doesn't work
|
||||
if ($doesntrun{$pidfile}) {
|
||||
@ -2612,10 +2530,10 @@ sub runnegtelnetserver {
|
||||
}
|
||||
unlink($pidfile) if(-f $pidfile);
|
||||
|
||||
$srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
|
||||
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
my $srvrname = servername_str($proto, $ipvnum, $idnum);
|
||||
my $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
|
||||
|
||||
my $flags = "";
|
||||
$flags .= "--verbose 1 " if($debugprotocol);
|
||||
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
|
||||
$flags .= "--id $idnum " if($idnum > 1);
|
||||
|
Loading…
Reference in New Issue
Block a user