summaryrefslogtreecommitdiff
path: root/src/or/cpuworker.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-03Retire U64_TO_DBL and DBL_TO_U64Nick Mathewson
These were necessary long ago to work around a bug in VC6.
2018-06-28Move weakrng into lib/intmathNick Mathewson
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-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
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-04-05Move responsibility for threadpool reply-handler events to workqueueNick Mathewson
This change makes cpuworker and test_workqueue no longer need to include event2/event.h. Now workqueue.c needs to include it, but that is at least somewhat logical here.
2018-04-02use channel_is_client for create cell countsRoger Dingledine
When a relay is collecting internal statistics about how many create cell requests it has seen of each type, accurately count the requests from relays that temporarily fall out of the consensus. (To be extra conservative, we were already ignoring requests from clients in our counts, and we continue ignoring them here.) Fixes bug 24910; bugfix on 0.2.4.17-rc.
2018-02-07more fixes for typos, grammar, whitespace, etcRoger Dingledine
some of these ought to have been noticed by the "misspell" tool, so if anybody is debugging it, here are some bug reports :)
2017-12-08Convert remaining function (mostly static) to new free styleNick Mathewson
2017-07-27Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-27Fix the cpuworker.c documentation to mention all the kinds of workNick Mathewson
2017-07-27Always start with one additional worker threadNick Mathewson
Now that half the threads are permissive and half are strict, we need to make sure we have at least two threads, so that we'll have at least one of each kind.
2017-07-27Queue consensus diffs at LOW priority.Nick Mathewson
Fixes bug 22883.
2017-07-07Explicit length checks in circuit_init_cpath_crypto().George Kadianakis
2017-06-21make assign_onionskin_to_cpuworker failure case more clearRoger Dingledine
now it looks like the other time we call it
2017-06-21Merge branch 'bug22356_029' into maint-0.3.1Nick Mathewson
2017-06-19Downgrade "assign_to_cpuworker failed" to INFO.Nick Mathewson
Closes ticket 22356
2017-04-24Make cpuworker_queue_work function mockable.Nick Mathewson
I'll be using this in the unit tests for consdiffmgr.
2017-04-15Expand cpuworker API to allow other work typesNick Mathewson
2017-03-15Run the copyright update script.Nick Mathewson
2016-10-31Actually free the worker_state_t object when we do an update with itNick Mathewson
Previously we freed the old "keys" object, but leaked the worker_state_t that we had taken it from. Fixes bug 20401; bugfix on 0.2.6.3-alpha.
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-07-04Raise libevent dependency to 2.0.10-stable or newerSebastian Hahn
Only some very ancient distributions don't ship with Libevent 2 anymore, even the oldest supported Ubuntu LTS version has it. This allows us to get rid of a lot of compat code.
2016-02-27Update the copyright year.Nick Mathewson
2015-08-21Ensure worker threads actually exit when it is timeSebastian Hahn
This includes a small refactoring to use a new enum (workqueue_reply_t) for the return values instead of just ints.
2015-03-12add an explanatory commentNick Mathewson
2015-03-12Also, add an assertion to assign_onionskin_to_cpuworkerNick Mathewson
2015-03-12Fix crash bug when calling cpuworkers_rotate_keyinfo on a client.Nick Mathewson
Fixes bug 15245; bugfix on 0.2.6.3-alpha. Thanks to anonym for reporting!
2015-02-16Fix a few coverity "Use after NULL check" warningsNick Mathewson
Also remove the unit test mocks that allowed get_options() to be NULL; that's an invariant violation for get_options().
2015-02-15Call cpu_init if we change to being a relaySebastian Hahn
The issue is that we use the cpuworker system with relays only, so if we start up as a client and transition to being a relay later, we'll be sad. This fixes bug 14901; not in any released version of Tor.
2015-02-09Add some comments to or_circuit_t.workqueue_entrySebastian Hahn
These were suggested by dgoulet, thanks!
2015-02-09Avoid use-after-free of circ belonging to cancelled jobSebastian Hahn
This fixes a bug where we decide to free the circuit because it isn't on any workqueue anymore, and then the job finishes and the circuit gets freed again. Fixes bug #14815, not in any released version of Tor.
2015-02-05Fix a work-counting bug introduced by the workqueue mergeNick Mathewson
David Goulet finds that when he runs a busy relay for a while with the latest version of the git code, the number of onionskins handled slowly dwindles to zero, with total_pending_tasks wedged at its maximum value. I conjecture this is because the total_pending_tasks variable isn't decremented when we successfully cancel a job. Fixed that. Fixes bug 14741; bugfix not on any released version of tor.
2015-01-26Bail early in cpuworker_onion_handshake_replyfn if the circuit is markedNick Mathewson
2015-01-23whitespace fixesNick Mathewson
2015-01-21Fix: remove whitespace and update a comment in cpuworker.cDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-15Update workqueue implementation to use a single queue for the workNick Mathewson
Previously I used one queue per worker; now I use one queue for everyone. The "broadcast" code is gone, replaced with an idempotent 'update' operation.
2015-01-14Avoid chan/circ linear lookups for requestsNick Mathewson
The solution I took is to not free a circuit with a pending uncancellable work item, but rather to set its magic number to a sentinel value. When we get a work item, we check whether the circuit has that magic sentinel, and if so, we free it rather than processing the reply.
2015-01-14Remove if (1) indentation in cpuworker.cNick Mathewson
To avoid having diffs turn out too big, I had replaced some unneeded ifs and fors with if (1), so that the indentation would still work out right. Now I might as well clean those up.
2015-01-14Refactor cpuworker to use workqueue/threadpool code.Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-02Apply new calloc coccinelle patchNick 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-08-13Apply coccinelle script to replace malloc(a*b)->calloc(a,b)Nick Mathewson
2014-06-20Thread support is now requiredNick Mathewson
Long ago we supported systems where there was no support for threads, or where the threading library was broken. We shouldn't have do that any more: on every OS that matters, threads exist, and the OS supports running threads across multiple CPUs. This resolves tickets 9495 and 12439. It's a prerequisite to making our workqueue code work better, since sensible workqueue implementations don't split across multiple processes.