Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / tests / httpserver.pl
blobae1bcec286d8537bf681f6f57c78254edd6503f7
1 #!/usr/bin/env perl
3 use strict;
5 my $verbose=0; # set to 1 for debugging
7 my $dir=".";
8 my $port = 8999; # just a default
9 my $ipv6;
10 my $pid=".http.pid"; # name of the pidfile
11 my $fork;
12 do {
13 if($ARGV[0] eq "-v") {
14 $verbose=1;
16 elsif($ARGV[0] eq "-d") {
17 $dir=$ARGV[1];
18 shift @ARGV;
20 elsif($ARGV[0] eq "-p") {
21 $pid=$ARGV[1];
22 shift @ARGV;
24 elsif($ARGV[0] eq "--fork") {
25 $fork = $ARGV[0];
26 shift @ARGV;
28 elsif($ARGV[0] =~ /^(\d+)$/) {
29 $port = $1;
31 elsif($ARGV[0] =~ /^ipv6/i) {
32 $ipv6="--ipv6 ";
34 } while(shift @ARGV);
36 exec("server/sws --pidfile $pid$fork $ipv6$port $dir");