summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-08-05 17:53:21 +0000
committerNick Mathewson <nickm@torproject.org>2006-08-05 17:53:21 +0000
commit7c596c166b27e44aceb2906f343cd8b261824fda (patch)
tree055b691e965089cfd1c75dcb27c8abef1c004531 /src/or/routerlist.c
parentdbac3fb481add618ed92e0f7870053be9c695c09 (diff)
downloadtor-7c596c166b27e44aceb2906f343cd8b261824fda.tar.gz
tor-7c596c166b27e44aceb2906f343cd8b261824fda.zip
r7029@Kushana: nickm | 2006-08-04 14:08:41 -0700
Remove now-spurious size and data arguments from tor_mmap_file svn:r6987
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index e9819ddd83..1984ddf28c 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -276,12 +276,10 @@ router_rebuild_store(int force)
goto done;
}
/* Our mmap is now invalid. */
- if (routerlist->mmap_handle) {
- tor_munmap_file(routerlist->mmap_handle);
- routerlist->mmap_handle = tor_mmap_file(fname,
- &routerlist->mmap_descriptors,
- &routerlist->mmap_descriptors_len);
- if (! routerlist->mmap_handle)
+ if (routerlist->mmap_descriptors) {
+ tor_munmap_file(routerlist->mmap_descriptors);
+ routerlist->mmap_descriptors = tor_mmap_file(fname);
+ if (! routerlist->mmap_descriptors)
log_warn(LD_FS, "Unable to mmap new descriptor file at '%s'.",fname);
}
@@ -340,12 +338,10 @@ router_reload_router_list(void)
router_journal_len = router_store_len = 0;
tor_snprintf(fname, fname_len, "%s/cached-routers", options->DataDirectory);
- routerlist->mmap_handle = tor_mmap_file(fname,
- &routerlist->mmap_descriptors,
- &routerlist->mmap_descriptors_len);
+ routerlist->mmap_descriptors = tor_mmap_file(fname);
if (routerlist->mmap_descriptors) {
- router_store_len = routerlist->mmap_descriptors_len;
- router_load_routers_from_string(routerlist->mmap_descriptors,
+ router_store_len = routerlist->mmap_descriptors->size;
+ router_load_routers_from_string(routerlist->mmap_descriptors->data,
SAVED_IN_CACHE, NULL);
}
@@ -1159,8 +1155,8 @@ signed_descriptor_get_body(signed_descriptor_t *desc)
tor_assert(len > 32);
if (desc->saved_location == SAVED_IN_CACHE && routerlist &&
routerlist->mmap_descriptors) {
- tor_assert(desc->saved_offset + len <= routerlist->mmap_descriptors_len);
- r = routerlist->mmap_descriptors + desc->saved_offset;
+ tor_assert(desc->saved_offset + len <= routerlist->mmap_descriptors->size);
+ r = routerlist->mmap_descriptors->data + desc->saved_offset;
} else {
r = desc->signed_descriptor_body;
}