use "HERE Document" method for calling cURL command.

This commit is contained in:
David Kerr 2016-03-18 13:07:26 -04:00
parent d5e8b32353
commit 816216ee29

View file

@ -2186,9 +2186,11 @@ sub geturl {
$0 = sprintf("%s - curl sending to %s", $program, '${protocol}://${server}/${url}'); $0 = sprintf("%s - curl sending to %s", $program, '${protocol}://${server}/${url}');
my $timeout = opt('timeout'); my $timeout = opt('timeout');
$reply = `/usr/bin/curl -si0 --user "${login}:${password}" --user-agent "${program}/${version}" \\ $reply = <<`USE_CURL`;
/usr/bin/curl -si0 --user '${login}:${password}' --user-agent '${program}/${version}' \\
--connect-timeout $timeout --max-time $timeout $curlopt \\ --connect-timeout $timeout --max-time $timeout $curlopt \\
--url "${protocol}://${server}/${url}" 2>/dev/null`; --url '${protocol}://${server}/${url}' 2>/dev/null
USE_CURL
if (! $reply) { if (! $reply) {
warning("curl cannot connect to ${protocol}://${server}/${url}"); warning("curl cannot connect to ${protocol}://${server}/${url}");