diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-11-05 20:15:27 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-11-05 20:15:27 +0000 |
commit | 75d85c8214eab8d6a06a60445307223c4a6a57d8 (patch) | |
tree | b26b4f4c4cfb16cc9f99bbecec0a99b78168c087 /src/or/directory.c | |
parent | 757def59b6909fdb36d663bab5a059b70e6d6b5d (diff) | |
download | tor-75d85c8214eab8d6a06a60445307223c4a6a57d8.tar.gz tor-75d85c8214eab8d6a06a60445307223c4a6a57d8.zip |
On directory servers, old_routers was wasting hundreds of bytes per superseded router descriptor. Roll the signed descriptor info and identifying info into a cache_info struct, and use only that for old_routers.
svn:r5349
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index bcd1a1f13b..82f46f3041 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -250,9 +250,9 @@ directory_initiate_command_router(routerinfo_t *router, uint8_t purpose, const char *payload, size_t payload_len) { directory_initiate_command(router->address, router->addr, router->dir_port, - router->platform, router->identity_digest, - purpose, private_connection, resource, - payload, payload_len); + router->platform, router->cache_info.identity_digest, + purpose, private_connection, resource, + payload, payload_len); } /** As directory_initiate_command_router, but send the command to a trusted @@ -1043,7 +1043,7 @@ connection_dir_client_reached_eof(connection_t *conn) /* this might have been a dirport reachability test. see if it is. */ routerinfo_t *me = router_get_my_routerinfo(); if (me && - !memcmp(me->identity_digest, conn->identity_digest, DIGEST_LEN) && + router_digest_is_me(conn->identity_digest) && me->addr == conn->addr && me->dir_port == conn->port) router_dirport_found_reachable(); @@ -1340,14 +1340,14 @@ directory_handle_command_get(connection_t *conn, char *headers, else { size_t len = 0; format_rfc1123_time(date, time(NULL)); - SMARTLIST_FOREACH(descs, routerinfo_t *, ri, + SMARTLIST_FOREACH(descs, signed_descriptor_t *, ri, len += ri->signed_descriptor_len); if (deflated) { size_t compressed_len; char *compressed; char *inp = tor_malloc(len+smartlist_len(descs)+1); char *cp = inp; - SMARTLIST_FOREACH(descs, routerinfo_t *, ri, + SMARTLIST_FOREACH(descs, signed_descriptor_t *, ri, { memcpy(cp, ri->signed_descriptor, ri->signed_descriptor_len); @@ -1375,7 +1375,7 @@ directory_handle_command_get(connection_t *conn, char *headers, date, (int)len); connection_write_to_buf(tmp, strlen(tmp), conn); - SMARTLIST_FOREACH(descs, routerinfo_t *, ri, + SMARTLIST_FOREACH(descs, signed_descriptor_t *, ri, connection_write_to_buf(ri->signed_descriptor, ri->signed_descriptor_len, conn)); |