]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make output of router_get_trusted_dir_servers const
authorNick Mathewson <nickm@torproject.org>
Sat, 8 Sep 2012 02:55:53 +0000 (22:55 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 6 Dec 2012 16:15:01 +0000 (11:15 -0500)
src/or/directory.c
src/or/dirserv.c
src/or/routerlist.c
src/or/routerlist.h

index 1d511b574984a6253f91e133a371a0e018f74cc9..c7fb0c4fb9e92fa9c1f3ff0f079779ece611771b 100644 (file)
@@ -244,7 +244,7 @@ router_supports_extrainfo(const char *identity_digest, int is_authority)
 int
 directories_have_accepted_server_descriptor(void)
 {
-  smartlist_t *servers = router_get_trusted_dir_servers();
+  const smartlist_t *servers = router_get_trusted_dir_servers();
   const or_options_t *options = get_options();
   SMARTLIST_FOREACH(servers, trusted_dir_server_t *, d, {
     if ((d->type & options->PublishServerDescriptor_) &&
@@ -280,7 +280,7 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
 {
   const or_options_t *options = get_options();
   int post_via_tor;
-  smartlist_t *dirservers = router_get_trusted_dir_servers();
+  const smartlist_t *dirservers = router_get_trusted_dir_servers();
   int found = 0;
   const int exclude_self = (dir_purpose == DIR_PURPOSE_UPLOAD_VOTE ||
                             dir_purpose == DIR_PURPOSE_UPLOAD_SIGNATURES);
@@ -716,7 +716,7 @@ connection_dir_download_v2_networkstatus_failed(dir_connection_t *conn,
     /* We're a non-authoritative directory cache; try again. Ignore status
      * code, since we don't want to keep trying forever in a tight loop
      * if all the authorities are shutting us out. */
-    smartlist_t *trusted_dirs = router_get_trusted_dir_servers();
+    const smartlist_t *trusted_dirs = router_get_trusted_dir_servers();
     SMARTLIST_FOREACH(trusted_dirs, trusted_dir_server_t *, ds,
                       download_status_failed(&ds->v2_ns_dl_status, 0));
     directory_get_from_dirserver(conn->base_.purpose, conn->router_purpose,
index c1ddf73ee4dd050b757b11da4b213b882766ec5e..8be436d9168453db66087dda4c6b2712caef6f69 100644 (file)
@@ -1478,7 +1478,7 @@ dirserv_set_cached_networkstatus_v2(const char *networkstatus,
                                     time_t published)
 {
   cached_dir_t *d, *old_d;
-  smartlist_t *trusted_dirs;
+  const smartlist_t *trusted_dirs;
   if (!cached_v2_networkstatus)
     cached_v2_networkstatus = digestmap_new();
 
index 1735837871e5fa46956d73b3690c7b4a17b3bd0d..2a146ba627474458b57cbf55f24f1a138bd00db2 100644 (file)
@@ -918,7 +918,7 @@ router_reload_router_list(void)
  * known trusted dirservers.  Callers must not modify the list or its
  * contents.
  */
-smartlist_t *
+const smartlist_t *
 router_get_trusted_dir_servers(void)
 {
   if (!trusted_dir_servers)
index c8381996d201f705fc6dea3cf2f5109464f7ba55..3c659e8ee8019e5c9280a718794f3c9ab265fa75 100644 (file)
@@ -25,7 +25,7 @@ void authority_cert_dl_failed(const char *id_digest, int status);
 void authority_certs_fetch_missing(networkstatus_t *status, time_t now);
 int router_reload_router_list(void);
 int authority_cert_dl_looks_uncertain(const char *id_digest);
-smartlist_t *router_get_trusted_dir_servers(void);
+const smartlist_t *router_get_trusted_dir_servers(void);
 
 const routerstatus_t *router_pick_directory_server(dirinfo_type_t type,
                                                    int flags);