1. 06 May, 2020 1 commit
    • Nick Mathewson's avatar
      Use __attribute__((fallthrough)) rather than magic GCC comments. · cc397449
      Nick Mathewson authored
      GCC added an implicit-fallthrough warning a while back, where it
      would complain if you had a nontrivial "case:" block that didn't end
      with break, return, or something like that.  Clang recently added
      the same thing.
      
      GCC, however, would let you annotate a fall-through as intended by
      any of various magic "/* fall through */" comments.  Clang, however,
      only seems to like "__attribute__((fallthrough))".  Fortunately, GCC
      accepts that too.
      
      A previous commit in this branch defined a FALLTHROUGH macro to do
      the right thing if GNUC is defined; here we replace all of our "fall
      through" comments with uses of that macro.
      
      This is an automated commit, made with the following perl one-liner:
      
        #!/usr/bin/perl -i -p
        s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
      cc397449
  2. 06 Sep, 2019 1 commit
  3. 19 Jun, 2019 1 commit
    • David Goulet's avatar
      guard: Ignore marked for close circuit when changing state to open · e3f34780
      David Goulet authored
      
      
      When we consider all circuits in "waiting for guard" state to be promoted to
      an "open" state, we were considering all circuits, even the one marked for
      close.
      
      This ultiamtely triggers a "circuit_has_opened()" called on the circuit that
      is marked for close which then leads to possible undesirable behaviors within
      a subsystem.
      
      For instance, the HS subsystem would be unable to find the authentication key
      of the introduction point circuit leading to a BUG() warning and a duplicate
      mark for close on the circuit.
      
      This commit also adds a unit test to make sure we never select marked for
      close circuits when upgrading its guard state from waiting for guard to open.
      
      Fixes #30871
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      e3f34780
  4. 31 May, 2019 1 commit
    • Nick Mathewson's avatar
      num_bridges_usable(): only count configured bridges. · 8015979e
      Nick Mathewson authored
      When this function was implemented, it counted all the entry guards
      in the bridge set.  But this included previously configured bridges,
      as well as currently configured ones!  Instead, only count the
      _filtered_ bridges (ones that are configured and possibly reachable)
      as maybe usable.
      
      Fixes bug 29875; bugfix on 0.3.0.1-alpha.
      8015979e
  5. 16 Jan, 2019 1 commit
  6. 22 Nov, 2018 1 commit
  7. 01 Oct, 2018 2 commits
  8. 25 Sep, 2018 1 commit
  9. 21 Sep, 2018 2 commits
    • Nick Mathewson's avatar
      Split directory.c code into several modules · 194acfb5
      Nick Mathewson authored
      Parts of this C file naturally belong in dircache, dirclient, and
      dircommon: so, move them there.
      194acfb5
    • Nick Mathewson's avatar
      Split main.c into main.c and mainloop.c · c7ce6b98
      Nick Mathewson authored
      The main.c code is responsible for initialization and shutdown;
      the mainloop.c code is responsible for running the main loop of Tor.
      
      Splitting the "generic event loop" part of mainloop.c from the
      event-loop-specific part is not done as part of this patch.
      c7ce6b98
  10. 19 Sep, 2018 1 commit
  11. 21 Jul, 2018 3 commits
  12. 05 Jul, 2018 2 commits
    • Nick Mathewson's avatar
      Fix every include path changed in the previous commit (automated) · ef486e3c
      Nick Mathewson authored
      I am very glad to have written this script.
      ef486e3c
    • Nick Mathewson's avatar
      Move literally everything out of src/or · 63b4ea22
      Nick Mathewson authored
      This commit won't build yet -- it just puts everything in a slightly
      more logical place.
      
      The reasoning here is that "src/core" will hold the stuff that every (or
      nearly every) tor instance will need in order to do onion routing.
      Other features (including some necessary ones) will live in
      "src/feature".  The "src/app" directory will hold the stuff needed
      to have Tor be an application you can actually run.
      
      This commit DOES NOT refactor the former contents of src/or into a
      logical set of acyclic libraries, or change any code at all.  That
      will have to come in the future.
      
      We will continue to move things around and split them in the future,
      but I hope this lays a reasonable groundwork for doing so.
      63b4ea22
  13. 01 Jul, 2018 2 commits
  14. 28 Jun, 2018 1 commit
  15. 26 Jun, 2018 2 commits
  16. 22 Jun, 2018 1 commit
  17. 21 Jun, 2018 1 commit
  18. 20 Jun, 2018 2 commits
  19. 15 Jun, 2018 2 commits
  20. 27 Apr, 2018 2 commits
  21. 22 Apr, 2018 1 commit
    • Nick Mathewson's avatar
      Check for "the right descriptor", not just "any descriptor". · 948dd2c7
      Nick Mathewson authored
      This patch adds a new node_has_preferred_descriptor() function, and
      replaces most users of node_has_descriptor() with it.  That's an
      important change, since as of d1874b43 (our fix for #25213),
      we are willing to say that a node has _some_ descriptor, but not the
      _right_ descriptor for a particular use case.
      
      Part of a fix for 25691 and 25692.
      948dd2c7
  22. 06 Apr, 2018 1 commit
  23. 05 Apr, 2018 1 commit
  24. 31 Jan, 2018 1 commit
  25. 18 Dec, 2017 1 commit
  26. 13 Dec, 2017 1 commit
    • teor's avatar
      Make sure bridges are definitely running before delaying directory fetches · 19a4abf2
      teor authored and Nick Mathewson's avatar Nick Mathewson committed
      Retry directory downloads when we get our first bridge descriptor
      during bootstrap or while reconnecting to the network. Keep retrying
      every time we get a bridge descriptor, until we have a reachable bridge.
      
      Stop delaying bridge descriptor fetches when we have cached bridge
      descriptors. Instead, only delay bridge descriptor fetches when we
      have at least one reachable bridge.
      
      Fixes bug 24367; bugfix on 0.2.0.3-alpha.
      19a4abf2
  27. 08 Dec, 2017 2 commits
  28. 29 Nov, 2017 1 commit
  29. 21 Nov, 2017 1 commit