Summary
The keysystems protocol (for Key-Systems / RRPproxy) is currently a LegacyProtocol, using the deprecated wantip key and legacy recap fields. It also contains a last bug that terminates the entire host loop on HTTP failure instead of skipping just the current host. This is a prerequisite for closing #172.
Current behaviour
nic_keysystems_update reads delete $config{$h}{'wantip'}. The request is:
GET <server>/update.php?hostname=<h>&password=<password>&ip=<ip>
(no scheme prefix is added — geturl handles it). Success is detected by /code = 200/ in the response body. Results are stored in recap{$h}{'ip'}, recap{$h}{'mtime'}, recap{$h}{'status'}.
Bug: On !header_ok($reply), the code uses last instead of next, causing the entire for my $h loop to exit when any host's HTTP request fails. Remaining hosts in the same run are silently skipped.
Migration requirements
- Convert to
Protocol->new (replacing LegacyProtocol->new).
- Fix the
last → next bug on !header_ok($reply).
- Read
wantipv4 and wantipv6 instead of wantip; investigate whether the Key-Systems DynDNS endpoint supports IPv6; if so, handle both families.
- Store results in
recap{$h}{'ipv4'} / recap{$h}{'status-ipv4'} and recap{$h}{'ipv6'} / recap{$h}{'status-ipv6'}.
- Add
t/protocol_keysystems.pl with test coverage for: success, code = 200 parsing, HTTP error (verifying next not last behavior), no-op.
References
Summary
The
keysystemsprotocol (for Key-Systems / RRPproxy) is currently aLegacyProtocol, using the deprecatedwantipkey and legacyrecapfields. It also contains alastbug that terminates the entire host loop on HTTP failure instead of skipping just the current host. This is a prerequisite for closing #172.Current behaviour
nic_keysystems_updatereadsdelete $config{$h}{'wantip'}. The request is:(no scheme prefix is added —
geturlhandles it). Success is detected by/code = 200/in the response body. Results are stored inrecap{$h}{'ip'},recap{$h}{'mtime'},recap{$h}{'status'}.Bug: On
!header_ok($reply), the code useslastinstead ofnext, causing the entirefor my $hloop to exit when any host's HTTP request fails. Remaining hosts in the same run are silently skipped.Migration requirements
Protocol->new(replacingLegacyProtocol->new).last→nextbug on!header_ok($reply).wantipv4andwantipv6instead ofwantip; investigate whether the Key-Systems DynDNS endpoint supports IPv6; if so, handle both families.recap{$h}{'ipv4'}/recap{$h}{'status-ipv4'}andrecap{$h}{'ipv6'}/recap{$h}{'status-ipv6'}.t/protocol_keysystems.plwith test coverage for: success,code = 200parsing, HTTP error (verifyingnextnotlastbehavior), no-op.References