aboutsummaryrefslogtreecommitdiff
path: root/src/or/hibernate.c
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-05Clean up include paths for libtor-evloop (automated)Nick Mathewson
2018-07-03Merge remote-tracking branch 'github/ticket26626'Nick Mathewson
2018-07-03Retire U64_TO_DBL and DBL_TO_U64Nick Mathewson
These were necessary long ago to work around a bug in VC6.
2018-07-03Return U64_PRINTF_ARG and U64_FORMATNick Mathewson
The standard is printf("%"PRIu64, x);
2018-07-01Remove system headers from or.hNick Mathewson
2018-07-01Extract or_state_t to its own header.Nick Mathewson
Fewer modules needed this than I had expected.
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-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Move or_connection_t to its own header.Nick Mathewson
2018-05-10Merge branch 'ticket26063_squashed'Nick Mathewson
2018-05-10Enable/disable per-second callback as needed.Nick Mathewson
There are three cases where this can happen: changes in our controller events, changes in our DisableNetwork setting, and changes in our hibernation state. Closes ticket 26063.
2018-05-09Give responsibility for waking up from DORMANT to a mainloop eventNick Mathewson
Closes ticket 26064.
2018-05-09Add we_are_fully_hibernating() to distinguish hibernation statesNick Mathewson
We want to tell "shut down" from "shutting down".
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
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-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-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
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
2017-10-31Merge branch 'bug23571_033_squashed'Nick Mathewson
2017-10-31Consistently use braced blocks in hibernate_go_dormant()teor
2017-10-31When hibernating, close connections normally and allow them to flushteor
Bugfix on 7267 in 0.2.4.7-alpha
2017-10-20Replace most bad exits in main.c, hibernate.cNick Mathewson
This should make most of the reasons that we hibernate cleaner.
2017-10-19Comment-only change: annotate exit() calls.Nick Mathewson
Sometimes when we call exit(), it's because the process is completely hopeless: openssl has a broken AES-CTR implementation, or the clock is in the 1960s, or something like that. But sometimes, we should return cleanly from tor_main() instead, so that embedders can keep embedding us and start another Tor process. I've gone through all the exit() and _exit() calls to annotate them with "exit ok" or "XXXX bad exit" -- the next step will be to fix the bad exit()s. First step towards 23848.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-08-25Merge branch 'bug19418_029' into maint-0.3.1Nick Mathewson
2017-08-09Make sure we always wind up checking i2d_*'s output.Nick Mathewson
The biggest offender here was sometimes not checking the output of crypto_pk_get_digest. Fixes bug 19418. Reported by Guido Vranken.
2017-08-01Merge remote-tracking branch 'public/bug22245_024' into maint-0.2.9Nick Mathewson
2017-05-15Merge branch 'bug22245_024'Nick Mathewson
2017-05-15Fix a logic error in hibernate.cNick Mathewson
Closes bug 22245; bugfix on 0.0.9rc1, when bandwidth accounting was first introduced. Found by Andrey Karpov and reported at https://www.viva64.com/en/b/0507/
2017-03-15Run the copyright update script.Nick Mathewson
2016-12-12Replace "people" with the appropriate network component in commentsJ. Ryan Stinnett
Fixes #18145.
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-08-31Don't warn on unlink(bw_accounting) when errno == ENOENTNick Mathewson
Patch from pastly; fixes bug 19964.
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-03-30Issue a `STATUS_SERVER` event on meaningful hibernation state changes.Yawning Angel
Implements feature #18685.
2016-02-27Update the copyright year.Nick Mathewson
2016-01-08Added AccountRule in and AccountingRule out optionsunixninja92
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-29Avoid frequent strcmp() calls for AccountingRuleNick Mathewson
Generally, we don't like to parse the same thing over and over; it's best IMO to do it once at the start of the code.
2014-09-29Add an "AccountingRule" feature to permit limiting bw usage by read+writeNick Mathewson
Patch from "chobe". Closes ticket 961.
2014-04-15Uplift status.c unit test coverage with new test cases and macros.dana koch
A new set of unit test cases are provided, as well as introducing an alternative paradigm and macros to support it. Primarily, each test case is given its own namespace, in order to isolate tests from each other. We do this by in the usual fashion, by appending module and submodule names to our symbols. New macros assist by reducing friction for this and other tasks, like overriding a function in the global namespace with one in the current namespace, or declaring integer variables to assist tracking how many times a mock has been called. A set of tests for a small-scale module has been included in this commit, in order to highlight how the paradigm can be used. This suite gives 100% coverage to status.c in test execution.
2014-03-31Always check returns from unlink()Andrea Shepard
2013-08-21Tweak/cleanup 5526 fix.Nick Mathewson
2013-08-21Print accounting information in heartbeat messages.Peter Retzlaff
Implements ticket 5526.
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.