summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfdeweerdt <fdeweerdt@cloudmark.com>2015-08-18 09:27:39 -0700
committerAliaksey Kandratsenka <alk@tut.by>2015-09-19 09:46:34 -0700
commit5078abdb331e63d7a216994f186eb736861f8df7 (patch)
treea9ecc017bf9874c968b9ca9d2cca59f19a23e7d1
parent54505f1d50c2d1f4676f5e87090b64a117fd980e (diff)
downloadgperftools-5078abdb331e63d7a216994f186eb736861f8df7.tar.gz
Don't discard curl options if timeout is not defined.
Editing the options passed to curl via 'my @URL_FETCHER = ("curl", "-s");' (in particular to add a -k to ignore self signed certs) fails for some invocations of curl. In FetchDynamicProfile, 'my @fetcher = AddFetchTimeout($fetch_timeout, @URL_FETCHER);' ends up being just 'curl' if timeout is not defined. This happens because AddFetchTimeout doesn't retrieve all the arguments from the caller. [alk@tut.by: updated commit message] Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
-rwxr-xr-xsrc/pprof2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pprof b/src/pprof
index c0c64bc..6abf528 100755
--- a/src/pprof
+++ b/src/pprof
@@ -3410,7 +3410,7 @@ sub ResolveRedirectionForCurl {
# Add a timeout flat to URL_FETCHER. Returns a new list.
sub AddFetchTimeout {
my $timeout = shift;
- my @fetcher = shift;
+ my @fetcher = @_;
if (defined($timeout)) {
if (join(" ", @fetcher) =~ m/\bcurl -s/) {
push(@fetcher, "--max-time", sprintf("%d", $timeout));