1. 06 May, 2020 3 commits
    • Nick Mathewson's avatar
      Use __attribute__((fallthrough)) rather than magic GCC comments. · 28ac17f4
      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;
      
      (In order to avoid conflicts, I'm applying this script separately to
      each maint branch. This is the 0.4.2 version.)
      28ac17f4
    • Nick Mathewson's avatar
      Use __attribute__((fallthrough)) rather than magic GCC comments. · 79ff2b6a
      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;
      
      (In order to avoid conflicts, I'm applying this script separately to
      each maint branch. This is the 0.4.1 version.)
      79ff2b6a
    • 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. 30 Sep, 2019 1 commit
  3. 10 Sep, 2019 1 commit
    • Nick Mathewson's avatar
      pf: when extracting an IPv6 address, make sure we got an IPv6 address · 97f7efa9
      Nick Mathewson authored
      Our code assumes that when we're configured to get IPv6 addresses
      out of a TRANS_PF transparent proxy connection, we actually will.
      But we didn't check that, and so FreeBSD started warning us about a
      potential NULL pointer dereference.
      
      Fixes part of bug 31687; bugfix on 0.2.3.4-alpha when this code was
      added.
      97f7efa9
  4. 05 Sep, 2019 1 commit
  5. 28 Jun, 2019 1 commit
  6. 16 May, 2019 1 commit
  7. 29 Apr, 2019 2 commits
    • David Goulet's avatar
      sendme: Always close stream if deliver window is negative · 0e6e800c
      David Goulet authored
      
      
      Previously, we would only close the stream when our deliver window was
      negative at the circuit-level but _not_ at the stream-level when receiving a
      DATA cell.
      
      This commit adds an helper function connection_edge_end_close() which
      sends an END and then mark the stream for close for a given reason.
      
      That function is now used both in case the deliver window goes below zero for
      both circuit and stream level.
      
      Part of #26840
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      0e6e800c
    • David Goulet's avatar
      sendme: Move code to the new files sendme.{c|h} · e5806dce
      David Goulet authored
      
      
      Take apart the SENDME cell specific code and put it in sendme.{c|h}. This is
      part of prop289 that implements authenticated SENDMEs.
      
      Creating those new files allow for the already huge relay.c to not grow in LOC
      and makes it easier to handle and test the SENDME cells in an isolated way.
      
      This commit only moves code. No behavior change.
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      e5806dce
  8. 17 Apr, 2019 2 commits
  9. 25 Mar, 2019 1 commit
  10. 16 Jan, 2019 2 commits
  11. 09 Jan, 2019 1 commit
    • Kris Katterjohn's avatar
      Fix (and make consistent) the use of OpenBSD preprocessor macro tests · c13a81f7
      Kris Katterjohn authored and Nick Mathewson's avatar Nick Mathewson committed
      Prior to this commit, the testsuite was failing on OpenBSD.  After
      this commit the testsuite runs fine on OpenBSD.
      
      It was previously decided to test for the OpenBSD macro (rather than
      __OpenBSD__, etc.) because OpenBSD forks seem to have the former
      macro defined.  sys/param.h must be included for the OpenBSD macro
      definition; however, many files tested for the OpenBSD macro without
      having this header included.
      
      This commit includes sys/param.h in the files where the OpenBSD macro
      is used (and sys/param.h is not already included), and it also
      changes some instances of the __OpenBSD__ macro to OpenBSD.
      
      See commit 27df23ab
      
       which changed
      everything to use OpenBSD instead of __OpenBSD__ or OPENBSD.  See
      also tickets #6982 and #20980 (the latter ticket is where it was
      decided to use the OpenBSD macro).
      
      Signed-off-by: default avatarKris Katterjohn <katterjohn@gmail.com>
      c13a81f7
  12. 02 Jan, 2019 1 commit
  13. 04 Dec, 2018 1 commit
    • David Goulet's avatar
      conn: Add an helper to mark a connection as waiting for an HS descriptor · d0682fe0
      David Goulet authored
      
      
      The transition for a connection to either become or go back in
      AP_CONN_STATE_RENDDESC_WAIT state must make sure that the entry connection is
      _not_ in the waiting for circuit list.
      
      This commit implements the helper function
      connection_ap_mark_as_waiting_for_renddesc() that removes the entry connection
      from the pending list and then change its state. This code pattern is used in
      many places in the code where next commit will remove this code duplication to
      use this new helper function.
      
      Part of #28669
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      d0682fe0
  14. 26 Nov, 2018 1 commit
    • Nick Mathewson's avatar
      Add options to control dormant-client feature. · 3743f796
      Nick Mathewson authored
      The DormantClientTimeout option controls how long Tor will wait before
      going dormant.  It also provides a way to disable the feature by setting
      DormantClientTimeout to e.g. "50 years".
      
      The DormantTimeoutDisabledByIdleStreams option controls whether open but
      inactive streams count as "client activity".  To implement it, I had to
      make it so that reading or writing on a client stream *always* counts as
      activity.
      
      Closes ticket 28429.
      3743f796
  15. 14 Nov, 2018 1 commit
  16. 14 Oct, 2018 1 commit
  17. 27 Sep, 2018 1 commit
    • Nick Mathewson's avatar
      Move the predicted ports code out of rephist.c · 241c1505
      Nick Mathewson authored
      It differs from the rest of the rephist code in that it's actually
      necessary for Tor to operate, so it should probably go somewhere
      else.  I'm not sure where yet, so I'll leave it in the same
      directory, but give it its own file.
      241c1505
  18. 25 Sep, 2018 2 commits
  19. 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
  20. 15 Sep, 2018 6 commits
  21. 12 Sep, 2018 1 commit
  22. 28 Aug, 2018 1 commit
  23. 10 Jul, 2018 1 commit
  24. 05 Jul, 2018 3 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
    • Nick Mathewson's avatar
      2d69c32b
  25. 03 Jul, 2018 1 commit
  26. 01 Jul, 2018 1 commit