aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-09-22 01:51:14 +0000
committerNick Mathewson <nickm@torproject.org>2005-09-22 01:51:14 +0000
commit66930319473ff63796672f26d52890f60666e770 (patch)
tree5516f91bbc951baf3fc05ce96a40196744227e80 /src/or/or.h
parent959598fae626545e54db9c6af0b4993341279acc (diff)
downloadtor-66930319473ff63796672f26d52890f60666e770.tar
tor-66930319473ff63796672f26d52890f60666e770.tar.gz
Use a separate type for "local view of router status". Also, even though I told arma there was no need, replace an ugly O ( n lg n ) algorithm with a nice O ( n ) algorithm when stepping through servers. Some ugliness is just too bad to stand.
svn:r5109
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/or.h b/src/or/or.h
index f5d4b4122..485fc171f 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -800,11 +800,15 @@ typedef struct routerstatus_t {
unsigned int is_running:1; /**< True iff this router is up. */
unsigned int is_named:1; /**< True iff "nickname" belongs to this router. */
unsigned int is_valid:1; /**< True iff this router is validated. */
- uint8_t n_download_failures; /**< Only used in summary list: number of
- * failures trying to download the most
- * recent descriptor. */
} routerstatus_t;
+/** DOCDOC */
+typedef struct local_routerstatus_t {
+ routerstatus_t status;
+ uint8_t n_download_failures; /**< Number of failures trying to download the
+ * most recent descriptor. */
+} local_routerstatus_t;
+
/*XXXX011 make this configurable? */
#define MAX_ROUTERDESC_DOWNLOAD_FAILURES 8
@@ -2116,7 +2120,7 @@ void add_trusted_dir_server(const char *addr, uint16_t port,
const char *digest, int supports_v1);
void clear_trusted_dir_servers(void);
networkstatus_t *networkstatus_get_by_digest(const char *digest);
-routerstatus_t *router_get_combined_status_by_digest(const char *digest);
+local_routerstatus_t *router_get_combined_status_by_digest(const char *digest);
void update_networkstatus_cache_downloads(time_t now);
void update_networkstatus_client_downloads(time_t now);
void update_router_descriptor_downloads(time_t now);