From: Wouter Wijngaards Date: Tue, 17 Apr 2018 12:18:34 +0000 (+0000) Subject: - auth zone notify work. X-Git-Tag: release-1.7.1rc1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=630600e70d7e2bde567117f597af844adde2bb0d;p=thirdparty%2Funbound.git - auth zone notify work. git-svn-id: file:///svn/unbound/trunk@4627 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 826d2fcd1..4c1abc81d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +17 April 2018: Wouter + - auth zone notify work. + 16 April 2018: Wouter - Fix auth zone target lookup iterator. - auth zone notify with prefix diff --git a/services/authzone.c b/services/authzone.c index 5698a3c6e..8143803f8 100644 --- a/services/authzone.c +++ b/services/authzone.c @@ -3312,6 +3312,30 @@ xfr_serial_means_update(struct auth_xfer* xfr, uint32_t serial) return 0; } +/** note notify serial, updates the notify information in the xfr struct */ +static void +xfr_note_notify_serial(struct auth_xfer* xfr, int has_serial, uint32_t serial) +{ + if(xfr->notify_received && xfr->notify_has_serial && has_serial) { + /* see if this serial is newer */ + if(compare_serial(xfr->notify_serial, serial) < 0) + xfr->notify_serial = serial; + } else if(xfr->notify_received && xfr->notify_has_serial && + !has_serial) { + /* remove serial, we have notify without serial */ + xfr->notify_has_serial = 0; + xfr->notify_serial = 0; + } else if(xfr->notify_received && !xfr->notify_has_serial) { + /* we already have notify without serial, keep it + * that way; no serial check when current operation + * is done */ + } else { + xfr->notify_received = 1; + xfr->notify_has_serial = has_serial; + xfr->notify_serial = serial; + } +} + /** process a notify serial, start new probe or note serial. xfr is locked */ static void xfr_process_notify(struct auth_xfer* xfr, struct module_env* env, @@ -3324,25 +3348,7 @@ xfr_process_notify(struct auth_xfer* xfr, struct module_env* env, /* start new probe with this addr src, or note serial */ if(!xfr_start_probe(xfr, env, fromhost)) { /* not started because already in progress, note the serial */ - if(xfr->notify_received && xfr->notify_has_serial && - has_serial) { - /* see if this serial is newer */ - if(compare_serial(xfr->notify_serial, serial) < 0) - xfr->notify_serial = serial; - } else if(xfr->notify_received && xfr->notify_has_serial && - !has_serial) { - /* remove serial, we have notify without serial */ - xfr->notify_has_serial = 0; - xfr->notify_serial = 0; - } else if(xfr->notify_received && !xfr->notify_has_serial) { - /* we already have notify without serial, keep it - * that way; no serial check when current operation - * is done */ - } else { - xfr->notify_received = 1; - xfr->notify_has_serial = has_serial; - xfr->notify_serial = serial; - } + xfr_note_notify_serial(xfr, has_serial, serial); lock_basic_unlock(&xfr->lock); } }