summaryrefslogtreecommitdiff
path: root/src/or/circuitmux.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-03Return U64_PRINTF_ARG and U64_FORMATNick Mathewson
The standard is printf("%"PRIu64, x);
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Extract cell type and their queues into new headersNick Mathewson
Since packed_cell and destroy_cell exist only to be queued, they go in the same headers as the queues.
2018-06-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-02-15cmux: Always use the cmux policyDavid Goulet
Remove the checks on cmux->policy since it should always be set. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-15cmux: Remove round-robin circuit policyDavid Goulet
Since 0.2.4, tor uses EWMA circuit policy to prioritize. The previous algorithm, round-robin, hasn't been used since then but was still used as a fallback. Now that EWMA is mandatory, remove that code entirely and enforce a cmux policy to be set. This is part of a circuitmux cleanup to improve performance and reduce complexity in the code. We'll be able to address future optimization with this work. Closes #25268 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-15cmux: Remove PARANOIA assert functionsDavid Goulet
The reason to do so is because these functions haven't been used in years so since 0.2.4, every callsite is NOP. In future commits, we'll remove the round robin circuit policy which is mostly validated within those function. This simplifies the code greatly and remove dead code for which we never had a configure option in the first place nor an easy way to use them in production. Part of #25268 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-21Merge branch 'maint-0.3.2'Nick Mathewson
2017-12-21Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2017-12-21Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-12-21Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-12-21Merge branch 'maint-0.2.5' into maint-0.2.8maint-0.2.8Nick Mathewson
2017-12-21Move destroy cells into a separate queue type of their own, to save RAMNick Mathewson
We've been seeing problems with destroy cells queues taking up a huge amount of RAM. We can mitigate this, since while a full packed destroy cell takes 514 bytes, we only need 5 bytes to remember a circuit ID and a reason. Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues were introduced.
2017-12-08Update free functions into macros: src/or/ part 1Nick Mathewson
This covers addressmap.h (no change needed) through confparse.h
2017-09-15Merge branch 'scan-build-032'Nick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-12Clear up dead-assignment warnings from scan-buildNick Mathewson
2017-03-15Run the copyright update script.Nick Mathewson
2016-10-18Turn circuitmux.c comments into module docs.Nick Mathewson
2016-06-11Add the -Wextra-semi warning from clang, and fix the cases where it triggersNick Mathewson
2016-02-27Update the copyright year.Nick Mathewson
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-11-27Merge remote-tracking branch 'andrea/cmux_refactor_configurable_threshold'Nick Mathewson
Conflicts: src/or/or.h src/test/Makefile.nmake
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-30Make circuitmux_compare_muxes() and circuitmux_get_policy() mockableAndrea Shepard
2014-09-30Make circuitmux_num_cells() mockableAndrea Shepard
2014-09-30Add cmux support for inter-cmux comparisonsAndrea Shepard
2014-09-02Another clang analyzer complaint wrt HT_GENERATENick Mathewson
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro with the result of a product. But that makes any sane analyzer worry about overflow. This patch keeps HT_GENERATE having its old semantics, since we aren't the only project using ht.h. Instead, define a HT_GENERATE2 that takes a reallocarrayfn.
2014-09-02Fix a number of clang analyzer false-positivesNick Mathewson
Most of these are in somewhat non-obvious code where it is probably a good idea to initialize variables and add extra assertions anyway. Closes 13036. Patches from "teor".
2014-06-16whitespace fixesNick Mathewson
2014-06-14Try to diagnose bug 12184Nick Mathewson
Check for consistency between the queued destroy cells and the marked circuit IDs. Check for consistency in the count of queued destroy cells in several ways. Check to see whether any of the marked circuit IDs have somehow been marked longer than the channel has existed.
2014-04-18scan-build: Be consistent with a needless check in circuitmux.cNick Mathewson
In circuitmux_detach_all_circuits, we check whether an HT iterator gives us NULL. That should be impossible for an HT iterator. But our checking it has confused scan-build (justly) into thinking that our later use of HT_NEXT_RMV might not be kosher. I'm taking the coward's route here and strengthening the check. Bugfix on fd31dd44. (Not a real bug though)
2014-03-14Test code for implementation of faster circuit_unlink_all_from_channelNick Mathewson
This contains the obvious implementation using the circuitmux data structure. It also runs the old (slow) algorithm and compares the results of the two to make sure that they're the same. Needs review and testing.
2013-10-28Merge branch 'morestats4' into morestats5Karsten Loesing
Conflicts: doc/tor.1.txt src/or/config.c src/or/connection.h src/or/control.c src/or/control.h src/or/or.h src/or/relay.c src/or/relay.h src/test/test.c
2013-07-19Initialize destroy_cell_queue.Nick Mathewson
Likely fix for the crash bug of #9296, which was introduced through a combination of #7912 and #8586. Bugfix not in any released Tor.
2013-07-18Use TOR_SIMPLEQ for packed_cell_tNick Mathewson
2013-07-10Add some basic unit tests for the circuit map data structure.Nick Mathewson
These show off the new mocking code by mocking the circuitmux code so that we can test the circuit map code in isolation.
2013-06-17Fix bug 9082: avoid leak when freeing destroy cell queuesNick Mathewson
In my #7912 fix, there wasn't any code to remove entries from the (channel, circuit ID)->circuit map corresponding to queued but un-sent DESTROYs. Spotted by skruffy. Fixes bug 9082; bug not in any released Tor.
2013-06-13Fix compile warnings wrt printf formating of int64_tNick Mathewson
2013-06-13Add destroy balance tracking and logging to circuitmuxAndrea Shepard
2013-06-13Implementation of a fix for bug 7912Nick Mathewson
I added the code to pass a destroy cell to a queueing function rather than writing it immediately, and the code to remember that we shouldn't reuse the circuit id until the destroy is actually sent, and the code to release the circuit id once the destroy has been sent... and then I finished by hooking destroy_cell_queue into the rest of Tor.
2013-03-10Fix 8447: use %u to format circid_t.Nick Mathewson
Now that circid_t is 4 bytes long, the default integer promotions will leave it alone when sizeof(int) == 4, which will leave us formatting an unsigned as an int. That's technically undefined behavior. Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not in any released Tor.
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-10-10Fix formatting in various places after 6465/6816 workAndrea Shepard
2012-10-10Don't remove circuitmux hash table entries in circuitmux_detach_circuit() ↵Andrea Shepard
until after circuitmux_make_circuit_inactive()
2012-10-10Fix 'warning: circuit was already inactive' and assert in ↵Andrea Shepard
circuitmux_make_circuit_inactive() during circuitmux_detach_all_circuits()
2012-10-10Bring summary comment block in circuitmux.c up to dateAndrea Shepard