From: Ian Jackson Date: Tue, 23 Jul 2019 16:33:41 +0000 (+0100) Subject: dgit: url_fetch: Honour new CurlOpts X-Git-Tag: archive/debian/9.6~6 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e9957b2d5326b0bdce0e5ca314fde99e213f53d8;p=dgit.git dgit: url_fetch: Honour new CurlOpts No functional change with the existing callers. Signed-off-by: Ian Jackson --- diff --git a/dgit b/dgit index 714d6b44..0f801a3d 100755 --- a/dgit +++ b/dgit @@ -1196,6 +1196,7 @@ sub url_fetch ($;@) { my ($url, %xopts) = @_; # Ok404 => 1 means give undef for 404 # AccessBase => 'archive-query' (eg) + # CurlOpts => { key => value } use WWW::Curl::Easy; @@ -1212,6 +1213,10 @@ sub url_fetch ($;@) { $setopt->(CURLOPT_NOSIGNAL, 1); $setopt->(CURLOPT_WRITEDATA, \$response_body); + my $xcurlopts = $xopts{CurlOpts} // { }; + keys %$xcurlopts; + while (my ($k,$v) = each %$xcurlopts) { $setopt->($k,$v); } + if ($xopts{AccessBase} && $url =~ m#^https://([-.0-9a-z]+)/#) { foreach my $k ("$xopts{AccessBase}-tls-key", "$xopts{AccessBase}-tls-curl-ca-args") {