porkbun: Delete unnecessary comments

This commit is contained in:
Richard Hansen 2024-07-23 01:05:02 -04:00
parent 3dae16457a
commit 4b5b8ab62d

View file

@ -6771,7 +6771,6 @@ sub nic_porkbun_update {
for my $host (@_) { for my $host (@_) {
my ($sub_domain, $domain); my ($sub_domain, $domain);
if ($config{$host}{'root-domain'}) { if ($config{$host}{'root-domain'}) {
# Process 'root-domain' option
$domain = $config{$host}{'root-domain'}; $domain = $config{$host}{'root-domain'};
$sub_domain = $host; $sub_domain = $host;
if ($host eq $domain) { if ($host eq $domain) {
@ -6779,18 +6778,15 @@ sub nic_porkbun_update {
} else { } else {
$sub_domain =~ s/\.$domain//; $sub_domain =~ s/\.$domain//;
} }
# Not valid if not an exact match and the root domain not stripped
if ($sub_domain eq $host) { if ($sub_domain eq $host) {
failed("'root-domain' (%s) is not part of the full host name (%s)!", $domain, $host); failed("'root-domain' (%s) is not part of the full host name (%s)!", $domain, $host);
next; next;
} }
warning("%s has both 'root-domain' and 'on-root-domain' defined. The latter is ignored") if $config{$host}{'on-root-domain'}; warning("%s has both 'root-domain' and 'on-root-domain' defined. The latter is ignored") if $config{$host}{'on-root-domain'};
} elsif ($config{$host}{'on-root-domain'}) { } elsif ($config{$host}{'on-root-domain'}) {
# Process legacy 'on-root-domain' option
$sub_domain = ''; $sub_domain = '';
$domain = $host; $domain = $host;
} else { } else {
# Default to the subdomain/domain being split at the first dot
($sub_domain, $domain) = split(/\./, $host, 2); ($sub_domain, $domain) = split(/\./, $host, 2);
} }
info("subdomain %s, root domain %s", $sub_domain, $domain) if $sub_domain ne ''; info("subdomain %s, root domain %s", $sub_domain, $domain) if $sub_domain ne '';
@ -6818,7 +6814,6 @@ sub nic_porkbun_update {
method => 'POST', method => 'POST',
data => $data, data => $data,
); );
# No response, declare as failed
if (!defined($reply) || !$reply) { if (!defined($reply) || !$reply) {
$config{$host}{"status-$ipv"} = "bad"; $config{$host}{"status-$ipv"} = "bad";
failed("updating %s: Could not connect to porkbun.com.", $host); failed("updating %s: Could not connect to porkbun.com.", $host);
@ -6829,8 +6824,6 @@ sub nic_porkbun_update {
failed("updating %s: failed (%s)", $host, $reply); failed("updating %s: failed (%s)", $host, $reply);
next; next;
} }
# Strip header
# Porkbun sends data in chunks, so it is assumed to be one chunk and parsed forcibly.
$reply =~ qr/{(?:[^{}]*|(?R))*}/mp; $reply =~ qr/{(?:[^{}]*|(?R))*}/mp;
my $response = eval { decode_json(${^MATCH}) }; my $response = eval { decode_json(${^MATCH}) };
if (!defined($response)) { if (!defined($response)) {
@ -6874,7 +6867,6 @@ sub nic_porkbun_update {
method => 'POST', method => 'POST',
data => $data, data => $data,
); );
# No response, declare as failed
if (!defined($reply) || !$reply) { if (!defined($reply) || !$reply) {
failed("updating %s: Could not connect to porkbun.com.", $host); failed("updating %s: Could not connect to porkbun.com.", $host);
next; next;