diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-04-29 18:42:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-04-29 18:42:26 +0000 |
commit | 2b720b574695313ed695218f218bb9d7c74aabc0 (patch) | |
tree | bbf69aa116c4f88b0832763d3538f8d221d4970d /src/or/routerparse.c | |
parent | 15dbe02c04d23ee9b1091f8d8bff2720868633e1 (diff) | |
download | tor-2b720b574695313ed695218f218bb9d7c74aabc0.tar.gz tor-2b720b574695313ed695218f218bb9d7c74aabc0.zip |
Start remembering *where* we are storing routerdescs. This will make us easier to move from a RAM-mirrors-disk model to a RAM-caches-disk model, and save maybe around 10MB on a directory server.
svn:r6427
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index bb30d1c0a4..ab1a2ca3bf 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -637,15 +637,17 @@ check_directory_signature(const char *digest, * are not complete. Returns 0 on success and -1 on failure. */ int -router_parse_list_from_string(const char **s, smartlist_t *dest) +router_parse_list_from_string(const char **s, smartlist_t *dest, + int from_cache) { routerinfo_t *router; - const char *end, *cp; + const char *end, *cp, *start; tor_assert(s); tor_assert(*s); tor_assert(dest); + start = *s; while (1) { *s = eat_whitespace(*s); /* Don't start parsing the rest of *s unless it contains a router. */ @@ -683,6 +685,10 @@ router_parse_list_from_string(const char **s, smartlist_t *dest) log_warn(LD_DIR, "Error reading router; skipping"); continue; } + if (from_cache) { + router->cache_info.saved_location = SAVED_IN_CACHE; + router->cache_info.saved_offset = *s - start; + } smartlist_add(dest, router); } |