From bdf88359046e6f98661fc0dd8dd86f362ed5948b Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 6 Jul 2020 23:45:33 -0400 Subject: [PATCH] Don't skip updates to remaining hosts if one host fails --- ChangeLog.md | 8 +++--- ddclient.in | 74 ++++++++++++++++++++++++++-------------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 5a5ad5f..f9c0d27 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -21,10 +21,10 @@ repository history](https://github.com/ddclient/ddclient/commits/master). ### Bug fixes - * Minor `freedns` protocol fixes, including: - * You can now update an address that differs from the system's own. - * If multiple hosts are defined and one fails, ddclient will no longer - skip the remaining hosts. + * If multiple hosts are defined and one fails, ddclient will no longer skip + the remaining hosts. + * Minor `freedns` protocol fixes. In particular, you can now update an + address that differs from the system's own. * Fixed a regression introduced in v3.9.0 that caused `use=ip,ip=` to fail. * "true" is now accepted as a boolean value. diff --git a/ddclient.in b/ddclient.in index c2a25da..ffd8d37 100755 --- a/ddclient.in +++ b/ddclient.in @@ -2616,7 +2616,7 @@ sub nic_dyndns1_update { failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; my ($title, $return_code, $error_code) = ('', '', ''); @@ -2782,9 +2782,9 @@ sub nic_dyndns2_update { }) // ''; if (!$reply) { failed("updating %s: Could not connect to %s.", $hosts, $config{$h}{'server'}); - last; + next; } - last if !header_ok($hosts, $reply); + next if !header_ok($hosts, $reply); my @reply = split /\n/, $reply; my $state = 'header'; @@ -2892,9 +2892,9 @@ sub nic_noip_update { }) // ''; if (!$reply) { failed("updating %s: Could not connect to %s.", $hosts, $config{$h}{'server'}); - last; + next; } - last if !header_ok($hosts, $reply); + next if !header_ok($hosts, $reply); my @reply = split /\n/, $reply; my $state = 'header'; @@ -3133,9 +3133,9 @@ sub nic_zoneedit1_update { }) // ''; if (!$reply) { failed("updating %s: Could not connect to %s.", $hosts, $config{$h}{'server'}); - last; + next; } - last if !header_ok($hosts, $reply); + next if !header_ok($hosts, $reply); my @reply = split /\n/, $reply; foreach my $line (@reply) { @@ -3288,9 +3288,9 @@ sub nic_easydns_update { }) // ''; if (!$reply) { failed("updating %s: Could not connect to %s.", $hosts, $config{$h}{'server'}); - last; + next; } - last if !header_ok($hosts, $reply); + next if !header_ok($hosts, $reply); my @reply = split /\n/, $reply; my $state = 'header'; @@ -3402,9 +3402,9 @@ sub nic_namecheap_update { my $reply = geturl({ proxy => opt('proxy'), url => $url }) // ''; if (!$reply) { failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); - last; + next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; if (grep /0/i, @reply) { @@ -3712,9 +3712,9 @@ sub nic_sitelutions_update { my $reply = geturl({ proxy => opt('proxy'), url => $url }); if (!defined($reply) || !$reply) { failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); - last; + next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; if (grep /success/i, @reply) { @@ -3927,9 +3927,9 @@ sub nic_changeip_update { }); if (!defined($reply) || !$reply) { failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); - last; + next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; if (grep /success/i, @reply) { @@ -4014,9 +4014,9 @@ sub nic_googledomains_update { }); unless ($reply) { failed("updating %s: Could not connect to %s.", $host, $config{$host}{'server'}); - last; + next; } - last if !header_ok($host, $reply); + next if !header_ok($host, $reply); # Cache $config{$host}{'ip'} = $ip; @@ -4223,9 +4223,9 @@ sub nic_cloudflare_update { my $reply = geturl({ proxy => opt('proxy'), url => $url, headers => $headers }); unless ($reply) { failed("updating %s: Could not connect to %s.", $domain, $config{$key}{'server'}); - last; + next; } - last if !header_ok($domain, $reply); + next if !header_ok($domain, $reply); # Strip header $reply =~ s/^.*?\n\n//s; @@ -4254,9 +4254,9 @@ sub nic_cloudflare_update { $reply = geturl({ proxy => opt('proxy'), url => $url, headers => $headers }); unless ($reply) { failed("updating %s: Could not connect to %s.", $domain, $config{$key}{'server'}); - last; + next; } - last if !header_ok($domain, $reply); + next if !header_ok($domain, $reply); # Strip header $reply =~ s/^.*?\n\n//s; @@ -4286,9 +4286,9 @@ sub nic_cloudflare_update { }); unless ($reply) { failed("updating %s: Could not connect to %s.", $domain, $config{$domain}{'server'}); - last; + next; } - last if !header_ok($domain, $reply); + next if !header_ok($domain, $reply); # Strip header $reply =~ s/^.*?\n\n//s; @@ -4370,9 +4370,9 @@ sub nic_yandex_update { my $reply = geturl({ proxy => opt('proxy'), url => $url, headers => $headers }); unless ($reply) { failed("updating %s: Could not connect to %s.", $host, $config{$key}{'server'}); - last; + next; } - last if !header_ok($host, $reply); + next if !header_ok($host, $reply); # Strip header $reply =~ s/^.*?\n\n//s; @@ -4407,9 +4407,9 @@ sub nic_yandex_update { }); unless ($reply) { failed("updating %s: Could not connect to %s.", $host, $config{$host}{'server'}); - last; + next; } - last if !header_ok($host, $reply); + next if !header_ok($host, $reply); # Strip header $reply =~ s/^.*?\n\n//s; @@ -4487,9 +4487,9 @@ sub nic_duckdns_update { # No response, declare as failed if (!defined($reply) || !$reply) { failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); - last; + next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; my $returned = pop(@reply); @@ -4558,9 +4558,9 @@ sub nic_freemyip_update { # No response, declare as failed if (!defined($reply) || !$reply) { failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); - last; + next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; my $returned = pop(@reply); @@ -4687,9 +4687,9 @@ sub nic_woima_update { }); if (!defined($reply) || !$reply) { failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); - last; + next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; my $state = 'header'; @@ -4805,9 +4805,9 @@ sub nic_dondominio_update { # No response, declare as failed if (!defined($reply) || !$reply) { failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); - last; + next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; my $returned = pop(@reply); @@ -4891,9 +4891,9 @@ sub nic_dnsmadeeasy_update { # No response, declare as failed if (!defined($reply) || !$reply) { failed("Updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); - last; + next; } - last if !header_ok($h, $reply); + next if !header_ok($h, $reply); my @reply = split /\n/, $reply; my $returned = pop(@reply);