[tor-bugs] #12538 [Tor]: Make all relays automatically be dir caches

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Dec 21 14:21:17 UTC 2015


#12538: Make all relays automatically be dir caches
-------------------------------------------------+-------------------------
 Reporter:  cypherpunks                          |          Owner:
     Type:  task                                 |         Status:
 Priority:  High                                 |  reopened
Component:  Tor                                  |      Milestone:  Tor:
 Severity:  Normal                               |  0.2.8.x-final
 Keywords:  tor-guard, tor-relay, prop237,       |        Version:  Tor:
  026-triaged-1, sebastian-review,               |  unspecified
  027-triaged-1-out, 028-triage, 028-triaged,    |     Resolution:
  mike-can, pre028-patch, TorCoreTeam201512,     |  Actual Points:
  201511-deferred                                |         Points:
Parent ID:                                       |  medium/large
  Sponsor:                                       |
-------------------------------------------------+-------------------------
Changes (by cypherpunks):

 * status:  closed => reopened
 * resolution:  implemented =>


Comment:

 Jenkins has two complaints.

 {{{
 ../src/test/test_dir.c:29:29: fatal error: test_dir_common.h: No such file
 or directory
  #include "test_dir_common.h"
                              ^
 }}}
 This seems to be a header missing from the build configuration.

 {{{
 src/or/config.c:4102:28: error: implicit conversion loses integer
 precision: 'const uint64_t' (aka 'const unsigned long long') to 'size_t'
 (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
       total_mem = options->MaxMemInQueues;
                 ~ ~~~~~~~~~^~~~~~~~~~~~~~
 }}}
 After looking at the have_enough_mem_for_dircache function where this
 error occurred i have some questions.

 * Why overwrite the total_mem parameter instead of using a separate
 variable? It makes it a bit harder to read.
 * Why does the get_total_system_memory function have a size_t parameter
 instead of an uint64_t? Using an uint64_t would simplify the function and,
 after changing the relevant type signatures, would solve the error.
   - Also, what is up with the yoda statements in get_total_system_memory
 and get_total_system_memory_impl?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12538#comment:97>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list