Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket25762 034 01 #50

Closed
wants to merge 6 commits into from

Commits on Apr 16, 2018

  1. main: Sort alphabetically periodic event callbacks

    No behavior change, just to make it easier to find callbacks and for the sake
    of our human brain to parse the list properly.
    
    Signed-off-by: David Goulet <dgoulet@torproject.org>
    dgoulet-tor committed Apr 16, 2018
    Copy the full SHA
    610d403 View commit details
    Browse the repository at this point in the history
  2. Specialize the periodic events on a per-role basis

    In tor, we have a series of possible "roles" that the tor daemon can be
    enabled for. They are:
    
      Client, Bridge, Relay, Authority (directory or bridge) and Onion service.
    
    They can be combined sometimes. For instance, a Directory Authority is also a
    Relay. This adds a "roles" field to a periodic event item object which is used
    to know for which roles the event is for.
    
    The next step is to enable the event only if the roles apply. No behavior
    change at this commit.
    
    Pars of #25762
    
    Signed-off-by: David Goulet <dgoulet@torproject.org>
    dgoulet-tor committed Apr 16, 2018
    Copy the full SHA
    a0ce184 View commit details
    Browse the repository at this point in the history
  3. main: Set up periodic events by roles only

    This is the next step where we only setup the events for the roles we are
    configured for.
    
    This commit builds but won't work because we can setup twice the same events
    because the roles can be combined. Next commit will add a fix to guard against
    that since now it is a reality.
    
    Signed-off-by: David Goulet <dgoulet@torproject.org>
    dgoulet-tor committed Apr 16, 2018
    Copy the full SHA
    2fe7925 View commit details
    Browse the repository at this point in the history
  4. main: Safeguard against multiple periodic event set up

    When we set up a periodic event, the mainloop event object is created. Use
    this to know if the event is already set up and if so, we don't set it up
    again.
    
    We also only schedule or launche a periodic event if that object is set.
    
    Signed-off-by: David Goulet <dgoulet@torproject.org>
    dgoulet-tor committed Apr 16, 2018
    Copy the full SHA
    46b3cb6 View commit details
    Browse the repository at this point in the history
  5. main: Add debug log of enabled periodic event

    Useful for us to know which callbacks were enabled.
    
    Signed-off-by: David Goulet <dgoulet@torproject.org>
    dgoulet-tor committed Apr 16, 2018
    Copy the full SHA
    42e6692 View commit details
    Browse the repository at this point in the history
  6. config: Set up periodic events when options changes

    In case we transitionned to a new role in Tor, we need to launch the right
    periodic events for it.
    
    Signed-off-by: David Goulet <dgoulet@torproject.org>
    dgoulet-tor committed Apr 16, 2018
    Copy the full SHA
    2d975d1 View commit details
    Browse the repository at this point in the history