]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'maint-0.3.3' into maint-0.3.4
authorNick Mathewson <nickm@torproject.org>
Mon, 9 Jul 2018 14:15:16 +0000 (10:15 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 9 Jul 2018 14:15:16 +0000 (10:15 -0400)
1  2 
src/or/router.c

diff --cc src/or/router.c
index 3879863e82aeddaba1b61647c3c21d41b43ddaf0,a3d7cd373c1a10cef9f731d72d44a6ef83f4f4b7..5485ec913e4d3e8854bf74e1b427456dedc0f520
@@@ -2636,12 -2523,11 +2637,14 @@@ check_descriptor_bandwidth_changed(time
  {
    static time_t last_changed = 0;
    uint64_t prev, cur;
-   if (!router_get_my_routerinfo())
+   const routerinfo_t *my_ri = router_get_my_routerinfo();
+   if (!my_ri) /* make sure routerinfo exists */
      return;
  
-   prev = router_get_my_routerinfo()->bandwidthcapacity;
+   prev = my_ri->bandwidthcapacity;
++
 +  /* Consider ourselves to have zero bandwidth if we're hibernating or
 +   * shutting down. */
    cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
    if ((prev != cur && (!prev || !cur)) ||
        cur > prev*2 ||
@@@ -3813,4 -3733,4 +3817,3 @@@ router_get_all_orports(const routerinfo
    fake_node.ri = (routerinfo_t *)ri;
    return node_get_all_orports(&fake_node);
  }
--