summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-08-25 20:33:17 +0000
committerNick Mathewson <nickm@torproject.org>2005-08-25 20:33:17 +0000
commit54a6a8f0ef2695423ce5e3e1583c97786a2449a5 (patch)
treed3b822efd1e52fc171cbc8d11a13b31e20339c31 /src/or/router.c
parentf0893ddc8c6372b67200dad5ff4cc16fbe2ecc69 (diff)
downloadtor-54a6a8f0ef2695423ce5e3e1583c97786a2449a5.tar.gz
tor-54a6a8f0ef2695423ce5e3e1583c97786a2449a5.zip
Start implementing the server side of the new directory protocol.
Probably very buggy, since I can't actually run an authdir. Features - Generate and publish new network-status format - Code to cache and re-serve network-status objects generated by others. - Publish individual descriptors (by fingerprint, by "all", and by "tell me yours.") [Still needs compression logic] - Publish client and server recommended versions seprately. - Add digest of descriptor to routerinfo_t, so we can track them better, and length, so we can server them more easily. Cleanups - Unify code to sign directory-like things - Make resolve_my_address() able to tell you which name it wound up resolving. - Unify code to store and serve directory-like things so it all uses cached_dir_t. - Unify code to set the value of cached_dir_t objects. svn:r4835
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 1244e9e3df..174f96f7fb 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -728,7 +728,7 @@ router_rebuild_descriptor(int force)
if (desc_clean_since && !force)
return 0;
- if (resolve_my_address(options, &addr) < 0) {
+ if (resolve_my_address(options, &addr, NULL) < 0) {
log_fn(LOG_WARN,"options->Address didn't resolve into an IP.");
return -1;
}
@@ -774,6 +774,9 @@ router_rebuild_descriptor(int force)
log_fn(LOG_WARN, "Couldn't dump router to string.");
return -1;
}
+ ri->signed_descriptor_len = strlen(ri->signed_descriptor);
+ crypto_digest(ri->signed_descriptor_digest,
+ ri->signed_descriptor, ri->signed_descriptor_len);
if (desc_routerinfo)
routerinfo_free(desc_routerinfo);