Skip to content

Commit

Permalink
Allow curl program and options to be specified in DDCLIENT_CURL env var
Browse files Browse the repository at this point in the history
Use this for testing.
  • Loading branch information
rrthomas committed Jul 10, 2023
1 parent 0990da3 commit ba6fab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ddclient.in
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ sub curl_cmd {
my @params = @_;
my $tmpfile;
my $tfh;
my $system_curl = quotemeta(subst_var('@CURL@', 'curl'));
my $system_curl = $ENV{DDCLIENT_CURL} // quotemeta(subst_var('@CURL@', 'curl'));
my %curl_codes = ( ## Subset of error codes from https://curl.haxx.se/docs/manpage.html
2 => "Failed to initialize. (Most likely a bug in ddclient, please open issue at https://github.com/ddclient/ddclient)",
3 => "URL malformed. The syntax was not correct",
Expand Down
3 changes: 3 additions & 0 deletions t/geturl_connectivity.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ my $http_daemon_supports_ipv6 = eval {
HTTP::Daemon->VERSION(6.12);
};

# Our test http server's certs can't be validated.
$ENV{DDCLIENT_CURL} = "@CURL@ --insecure";

# To aid in debugging, uncomment the following lines. (They are normally left commented to avoid
# accidentally interfering with the Test Anything Protocol messages written by Test::More.)
#STDOUT->autoflush(1);
Expand Down

0 comments on commit ba6fab3

Please sign in to comment.