]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
send the newconsensus event if the controller has asked for newconsensus
authorRoger Dingledine <arma@torproject.org>
Fri, 20 Feb 2009 10:25:08 +0000 (10:25 +0000)
committerRoger Dingledine <arma@torproject.org>
Fri, 20 Feb 2009 10:25:08 +0000 (10:25 +0000)
events, not if he's asked for ns events

svn:r18656

src/or/control.c
src/or/networkstatus.c

index 6a556ec30d4bf0f387eff2d69028419d394bdd0f..5600bdcfd91cdf5a8cff84a5afd3c532101d144f 100644 (file)
@@ -3568,6 +3568,8 @@ control_event_networkstatus_changed(smartlist_t *statuses)
 int
 control_event_newconsensus(const networkstatus_t *consensus)
 {
+  if (!control_event_is_interesting(EVENT_NEWCONSENSUS))
+    return 0;
   return control_event_networkstatus_changed_helper(
            consensus->routerstatus_list, EVENT_NEWCONSENSUS, "NEWCONSENSUS");
 }
index f9af470678209fbaaa02911943251a1ea0a0a3c8..8e340a4a574020cba9ffa82c098211b045e0575c 100644 (file)
@@ -1322,6 +1322,9 @@ notify_control_networkstatus_changed(const networkstatus_t *old_c,
    * as what they're listed as */
   control_event_newconsensus(new_c);
 
+  if (!control_event_is_interesting(EVENT_NS))
+    return;
+
   if (!old_c) {
     control_event_networkstatus_changed(new_c->routerstatus_list);
     return;
@@ -1486,8 +1489,7 @@ networkstatus_set_current_consensus(const char *consensus, unsigned flags)
   if (r != 1 && dl_certs)
     authority_certs_fetch_missing(c, now);
 
-  if (control_event_is_interesting(EVENT_NS))
-    notify_control_networkstatus_changed(current_consensus, c);
+  notify_control_networkstatus_changed(current_consensus, c);
 
   if (current_consensus) {
     networkstatus_copy_old_consensus_info(c, current_consensus);