1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

when failing to verify a HTTP server, display what curl said on stderr to

help debugging. (when using ipv6 I fell over this server that didn't have
the ipv6 module loaded)
This commit is contained in:
Daniel Stenberg 2004-12-12 23:31:45 +00:00
parent 22a0c57746
commit 4b1350e467

View File

@ -350,15 +350,19 @@ sub runhttpserver {
$pid = checkserver($pidfile);
# verify if our/any server is running on this port
my $cmd = "$CURL -o log/verifiedserver -g \"http://$ip:$port/verifiedserver\" 2>/dev/null";
my $cmd = "$CURL -o log/verifiedserver -g \"http://$ip:$port/verifiedserver\" 2>log/verifystderr";
print "CMD; $cmd\n" if ($verbose);
my $res = system($cmd);
$res >>= 8; # rotate the result
my $data;
print "RUN: curl command returned $res\n" if ($verbose);
if($res && $verbose) {
print "RUN: curl command returned $res\nRUN: ";
open(ERR, "<log/verifystderr");
print <ERR>;
close(ERR);
}
open(FILE, "<log/verifiedserver");
my @file=<FILE>;
close(FILE);