aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-03-02 22:29:58 +0000
committerNick Mathewson <nickm@torproject.org>2005-03-02 22:29:58 +0000
commitf90ccf5648309152e5d10b941cd3eb6cb0dce21a (patch)
treee5f6d2f344abb7852e7a6f1476f1cdbd990f564f /src/or/routerlist.c
parent4b5e213a0b91bcb6b3b848625f8ce6dd39381d6e (diff)
downloadtor-f90ccf5648309152e5d10b941cd3eb6cb0dce21a.tar.gz
tor-f90ccf5648309152e5d10b941cd3eb6cb0dce21a.zip
Implement new controller events for changed descriptors and new (not-yet-attached) streams.
svn:r3731
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index e521cae011..5c8a46a743 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -886,6 +886,11 @@ router_load_single_router(const char *s)
if (router_add_to_routerlist(ri)<0) {
log_fn(LOG_WARN, "Couldn't add router to list; dropping.");
return -1;
+ } else {
+ smartlist_t *changed = smartlist_create();
+ smartlist_add(changed, ri);
+ control_event_descriptors_changed(changed);
+ smartlist_free(changed);
}
log_fn(LOG_DEBUG, "Added router to list");
return 0;
@@ -914,16 +919,23 @@ int router_load_routerlist_from_directory(const char *s,
return -1;
}
if (routerlist) {
+ smartlist_t *changed = smartlist_create();
SMARTLIST_FOREACH(new_list->routers, routerinfo_t *, r,
- router_add_to_routerlist(r));
+ {
+ if (router_add_to_routerlist(r)==0)
+ smartlist_add(changed, r);
+ });
smartlist_clear(new_list->routers);
routerlist->published_on = new_list->published_on;
tor_free(routerlist->software_versions);
routerlist->software_versions = new_list->software_versions;
new_list->software_versions = NULL;
routerlist_free(new_list);
+ control_event_descriptors_changed(changed);
+ smartlist_free(changed);
} else {
routerlist = new_list;
+ control_event_descriptors_changed(routerlist->routers);
}
if (router_resolve_routerlist(routerlist)) {
log_fn(LOG_WARN, "Error resolving routerlist");