[tor-bugs] #9321 [Tor]: Load balance right when we have higher guard rotation periods

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Jan 7 14:52:11 UTC 2015


#9321: Load balance right when we have higher guard rotation periods
-------------------------+-------------------------------------------------
     Reporter:  arma     |      Owner:
         Type:  project  |     Status:  needs_review
     Priority:  normal   |  Milestone:  Tor: 0.2.6.x-final
    Component:  Tor      |    Version:
   Resolution:           |   Keywords:  needs-proposal, tor-auth, tor-
Actual Points:           |  client, 026-triaged-1
       Points:           |  Parent ID:  #11480
-------------------------+-------------------------------------------------

Comment (by teor):

 When I merge with 0.2.6.2 master, I get the following conflict:
 {{{
 <<<<<<< HEAD
     uint32_t *bandwidths_kb = tor_calloc(smartlist_len(votes),
                                          sizeof(uint32_t));
     uint32_t *measured_bws_kb = tor_calloc(smartlist_len(votes),
                                            sizeof(uint32_t));
 =======
     uint32_t *bandwidths_kb = tor_calloc(sizeof(uint32_t),
                                          smartlist_len(votes));
     uint32_t *measured_bws_kb = tor_calloc(sizeof(uint32_t),
                                            smartlist_len(votes));
     uint32_t *measured_guardfraction = tor_calloc(sizeof(uint32_t),
                                                smartlist_len(votes));
 >>>>>>> asn/bug9321_draft
 }}}

 The `tor_calloc_` prototype is:
 {{{
 void *
 tor_calloc_(size_t nmemb, size_t size
 }}}

 We can resolve it by changing each `tor_calloc` call to use nmemb then
 size:
 {{{
     uint32_t *bandwidths_kb = tor_calloc(smartlist_len(votes),
                                          sizeof(uint32_t));
     uint32_t *measured_bws_kb = tor_calloc(smartlist_len(votes),
                                            sizeof(uint32_t));
     uint32_t *measured_guardfraction = tor_calloc(smartlist_len(votes),
                                                   sizeof(uint32_t));
 }}}

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


More information about the tor-bugs mailing list