All pastes #993543 Raw Edit

Stuff

public diff v1 · immutable
#993543 ·published 2008-04-22 18:23 UTC
rendered paste body
=== src/or/routerlist.c==================================================================--- src/or/routerlist.c	(revision 15283)+++ src/or/routerlist.c	(local)@@ -4013,17 +4013,34 @@   smartlist_free(no_longer_old); } +/** How often should we launch a server/authority request to be sure of getting+ * a guess for our IP? */+/*XXXX021 this info should come from netinfo cells or something, or we should+ * do this only when we aren't seeing incoming data. see bug 652. */+#define DUMMY_DOWNLOAD_INTERVAL (20*60)+ /** Launch downloads for router status as needed. */ void update_router_descriptor_downloads(time_t now) {   or_options_t *options = get_options();+  static time_t last_dummy_download = 0;   if (should_delay_dir_fetches(options))     return;   if (directory_fetches_dir_info_early(options)) {     update_router_descriptor_cache_downloads_v2(now);   }   update_consensus_router_descriptor_downloads(now);++  if (server_mode(options) &&+      last_routerdesc_download_attempted + DUMMY_DOWNLOAD_INTERVAL < now &&+      last_dummy_download + DUMMY_DOWNLOAD_INTERVAL < now) {+    /* If we haven't tried to get any routerdescs in a long time, try a dummy+       fetch now. */+    last_dummy_download = now;+    directory_get_from_dirserver(DIR_PURPOSE_FETCH_SERVERDESC,+                                 ROUTER_PURPOSE_GENERAL, "authority.z", 1);+  } }  /** Launch extrainfo downloads as needed. */