diff options
| author | Peter Wu <peter@lekensteyn.nl> | 2014-11-27 23:59:23 +0100 | 
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2014-12-04 02:52:19 +0100 | 
| commit | f1cc2a2c0cf8e191e606c6093c679fbee95e8809 (patch) | |
| tree | 344ade6f1d0bc4a88c7a3d809455d8ff4a8e56b3 /tests/httpserver.pl | |
| parent | 99fb36797a3f0b64ad20fcb8b83026875640f8e0 (diff) | |
tests: add HTTP UNIX socket server testing support
The variable `$ipvnum` can now contain "unix" besides the integers 4
and 6 since the variable. Functions which receive this parameter
have their `$port` parameter renamed to `$port_or_path` to support a
path to the UNIX domain socket (as a "port" is only meaningful for TCP).
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'tests/httpserver.pl')
| -rwxr-xr-x | tests/httpserver.pl | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/httpserver.pl b/tests/httpserver.pl index a38c3cebd..1b8c3d284 100755 --- a/tests/httpserver.pl +++ b/tests/httpserver.pl @@ -36,6 +36,7 @@ use serverhelp qw(  my $verbose = 0;     # set to 1 for debugging  my $port = 8990;     # just a default +my $unix_socket;     # location to place a listening UNIX socket  my $ipvnum = 4;      # default IP version of http server  my $idnum = 1;       # dafault http server instance number  my $proto = 'http';  # protocol the http server speaks @@ -74,6 +75,13 @@ while(@ARGV) {      elsif($ARGV[0] eq '--ipv6') {          $ipvnum = 6;      } +    elsif($ARGV[0] eq '--unix-socket') { +        $ipvnum = 'unix'; +        if($ARGV[1]) { +            $unix_socket = $ARGV[1]; +            shift @ARGV; +        } +    }      elsif($ARGV[0] eq '--gopher') {          $gopher = 1;      } @@ -117,7 +125,12 @@ if(!$logfile) {  $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";  $flags .= "--gopher " if($gopher);  $flags .= "--connect $connect " if($connect); -$flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\""; +if($ipvnum eq 'unix') { +    $flags .= "--unix-socket '$unix_socket' "; +} else { +    $flags .= "--ipv$ipvnum --port $port "; +} +$flags .= "--srcdir \"$srcdir\"";  if($verbose) {      print STDERR "RUN: server/sws $flags\n";  | 
