summaryrefslogtreecommitdiff
path: root/src/or/main.h
AgeCommit message (Collapse)Author
2018-07-05Move literally everything out of src/orNick Mathewson
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.
2018-07-01Remove needless includes from or.hNick Mathewson
or.h should really include only the minimum of stuff from or/*, common/*, and lib/*.
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-05-10Merge branch 'ticket26063_squashed'Nick Mathewson
2018-05-10Add a new function to enable/disable the per-second timer as neededNick Mathewson
We're about to use this to turn off the per-second timer when the network is disabled and there aren't any per-second controller events enabled.
2018-05-03Move the "update the current second" code from second_elapsed_callbackNick Mathewson
This now happens in a new function, with the intent of having it invoked from our callbacks. This is one step on the way to 26009.
2018-05-01Ensure that voting is rescheduled whenever the schedule changes.Nick Mathewson
2018-04-30Move responsibility for or_state_save() to a scheduled callbackNick Mathewson
Closes ticket 25948.
2018-04-27hibernation: Rescan the event list on state changeDavid Goulet
When we change the hibernation state, rescan the main loop event list because the new state might affect the events. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-26Fix a test assertion failure due to uninitialized mainloop eventsNick Mathewson
Bug not in any released Tor.
2018-04-26Move close-and-cleanup functions to a postloop event.Nick Mathewson
Implements ticket 25932.
2018-04-23Merge remote-tracking branch 'dgoulet/ticket25762_034_05'Nick Mathewson
2018-04-23test: Add periodic events unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23config: Set up periodic events when options changesDavid Goulet
In case we transitionned to a new role in Tor, we need to launch and/or destroy some periodic events. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-17Move responsibility for recording read/written bytesNick Mathewson
Previously this was done as part of the refill callback, but there's no real reason to do it like that. Since we're trying to remove the refill callback completely, we can do this work as part of record_num_bytes_transferred_impl(), which already does quite a lot of this.
2018-04-13Merge branch 'token_bucket_once_again_squashed'Nick Mathewson
2018-04-13Merge branch 'postloop_callbacks_2'Nick Mathewson
2018-04-13Remove tell_event_loop_to_run_external_code() per reviewNick Mathewson
(This function is no longer used.)
2018-04-13Rename token_bucket_t to token_bucket_rw_t.Nick Mathewson
This is a simple search-and-replace to rename the token bucket type to indicate that it contains both a read and a write bucket, bundled with their configuration. It's preliminary to refactoring the bucket type.
2018-04-13Replace the global buckets with token_bucket_tNick Mathewson
2018-01-31refactor: using get_uptime() (and reset_uptime()) consistently.Caio Valente
Using get_uptime() and reset_uptime() instead of accessing stats_n_seconds_working directly. stats_n_seconds_working is not extern anymore. Ticket #25081
2018-01-19Merge branch 'disable_signal_handlers'Nick Mathewson
2017-12-20Merge remote-tracking branch 'ahf-oniongit/bugs/24605'Nick Mathewson
2017-12-20Merge remote-tracking branch 'ffmancera/github/bug23271'Nick Mathewson
2017-12-16Add MainloopStats option.Alexander Færøy
This patch adds support for MainloopStats that allow developers to get main event loop statistics via Tor's heartbeat status messages. The new status log message will show how many succesful, erroneous, and idle event loop iterations we have had. See: https://bugs.torproject.org/24605
2017-12-15Remove the unused is_parent==0 option from handle_signals.Nick Mathewson
2017-12-15Add remove file function and remove ephemeral files.Fernando Fernandez Mancera
Adding tor_remove_file(filename) and refactoring tor_cleanup(). Removing CookieAuthFile and ExtORPortCookieAuthFile when tor_cleanup() is called. Fixes #23271. Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-11-01Merge branch 'tor_api_squashed'Nick Mathewson
2017-11-01Add a public tor_api.h with an implementation in tor_api.cNick Mathewson
The main effect of this change is to commit to an extensible long-term API. Closes ticket 23684.
2017-10-20Expose a new function to make the event loop exit once and for all.Nick Mathewson
Instead of calling tor_cleanup(), exit(x), we can now call tor_shutdown_event_loop_and_exit.
2017-10-20Rename "tell_event_loop_to_finish" to "...run_external_code"Nick Mathewson
This function was never about 'finishing' the event loop, but rather about making sure that the code outside the event loop would be run at least once.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-05-08clang-i386: use house style for public-when-testing variablesNick Mathewson
This fixes a warning from jenkins.
2017-03-15Run the copyright update script.Nick Mathewson
2016-11-03Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2016-11-01refactor out the tor_event_base_loopexit() callRoger Dingledine
no actual changes
2016-08-20Unit test for pick_oos_victims()Andrea Shepard
2016-08-20Unit test for connection_handle_oos()Andrea Shepard
2016-08-20Implement connection_count_moribund() for OOS handlerAndrea Shepard
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-02-27Update the copyright year.Nick Mathewson
2016-02-22refactor directory_info_has_arrived so we can quiet the logsRoger Dingledine
no actual behavior changes
2015-11-17Some unit tests now require that periodic events be initialized.Nick Mathewson
2015-08-17Merge remote-tracking branches 'public/decouple_lost_owner' and ↵Nick Mathewson
'public/decouple_signals'
2015-08-13Decouple routerlist_retry_directory_downloads() from the blobNick Mathewson
Instead of having it call update_all_descriptor_downloads and update_networkstatus_downloads directly, we can have it cause them to get rescheduled and called from run_scheduled_events. Closes ticket 16789.
2015-08-12Try to decouple process_signal() from anything not event-drivenNick Mathewson
This needs debugging; it currently breaks the stem tests.
2015-07-21Remove casting of void pointers when handling signals.cypherpunks
2015-02-09Recover better when our clock jumps back many hoursRoger Dingledine
like might happen for Tails or Whonix users who start with a very wrong hardware clock, use Tor to discover a more accurate time, and then fix their clock. Resolves part of ticket 8766. (There are still some timers in various places that aren't addressed yet.)
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson