summaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
AgeCommit message (Collapse)Author
2017-10-23Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-10-23Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-10-23Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-09-29Clear outbuf_flushlen when we clear a connection's outbufNick Mathewson
When we added single_conn_free_bytes(), we cleared the outbuf on a connection without setting outbuf_flushlen() to 0. This could cause an assertion failure later on in flush_buf(). Fixes bug 23690; bugfix on 0.2.6.1-alpha.
2017-05-26Cleanup MOCK_IMPL (etc) to be findable with etagsNick Mathewson
A fair number of our mock_impl declarations were messed up so that even our special AM_ETAGSFLAGS couldn't find them. This should be a whitespace-only patch.
2017-05-08Merge branch 'netflow_padding-v6-rebased2-squashed'Nick Mathewson
2017-05-08Bug 17592: Clean up connection timeout logic.Mike Perry
This unifies CircuitIdleTimeout and PredictedCircsRelevanceTime into a single option, and randomizes it. It also gives us control over the default value as well as relay-to-relay connection lifespan through the consensus. Conflicts: src/or/circuituse.c src/or/config.c src/or/main.c src/test/testing_common.c
2017-04-18Rename `zlib_state` to `compress_state` in `dir_connection_t`.Alexander Færøy
This patch renames the `zlib_state` field in `dir_connection_t` to `compress_state`. See https://bugs.torproject.org/21663
2017-04-17Refactor the streaming compression code.Alexander Færøy
This patch refactors our streaming compression code to allow us to extend it with non-zlib/non-gzip based compression schemas. See https://bugs.torproject.org/21663
2017-04-07hs: Refactor circuitmap to use circuit_t instead of or_circuit_t.George Kadianakis
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-17Correctly maintain circuits in circuits_pending_other_guards().George Kadianakis
2017-01-16Merge remote-tracking branch 'public/ticket20921'Nick Mathewson
2017-01-12Have circuit_get_global_origin_circuit_list() return the right list. Bug 21118Nick Mathewson
2017-01-02Extract global_origin_circuit_list manipulation code into new fns.Nick Mathewson
Closes ticket 20921.
2016-12-21circuit: Add a function to get the next service intro circuitDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-16Merge branch 'prop271_030_v1_squashed'Nick Mathewson
2016-12-16Trivial documentation improvements.George Kadianakis
2016-12-16Remove guard_selection argument from status-reporting functionsNick Mathewson
This prevents us from mixing up multiple guard_selections
2016-12-16Expire circuits that have been WAITING_FOR_BETTER_GUARD too longNick Mathewson
(This is required by 3.9 in prop271, but is better done as a separate function IMO)
2016-12-16When freeing a guard state, cancel it if its state is unknownNick Mathewson
We don't want a guard to stay "pending" forever if the circuit_guard_state_t for it is freed before it succeeds or fails.
2016-12-14prop224 prepwork: Use of HS circuitmap in existing HS code.George Kadianakis
The new HS circuitmap API replaces old public functions as follows: circuit_clear_rend_token -> hs_circuitmap_remove_circuit circuit_get_rendezvous -> hs_circuitmap_get_rend_circ circuit_get_intro_point -> hs_circuitmap_get_intro_circ_v2 circuit_set_rendezvous_cookie -> hs_circuitmap_register_rend_circ circuit_set_intro_point_digest -> hs_circuitmap_register_intro_circ_v2 This commit also removes the old rendinfo code that is now unused. It also fixes the broken rendinfo unittests.
2016-11-30Use the new guard notification/selection APIs throughout TorNick Mathewson
This patch doesn't cover every case; omitted cases are marked with "XXXX prop271", as usual. It leaves both the old interface and the new interface for guard status notification, since they don't actually work in the same way: the new API wants to be told when a circuit has failed or succeeded, whereas the old API wants to know when a channel has failed or succeeded. I ran into some trouble with directory guard stuff, since when we pick the directory guard, we don't actually have a circuit to associate it with. I solved that by allowing guard states to be associated with directory connections, not just circuits.
2016-11-30Maintain a list of all the origin circuits.Nick Mathewson
We'll want this for upgrading waiting circuits.
2016-11-30Add a new GUARD_WAIT state for circuitsNick Mathewson
This state corresponds to the WAITING_FOR_BETTER_GUARD state; it's for circuits that are 100% constructed, but which we won't use until we are sure that we wouldn't use circuits with a better guard.
2016-11-30Write the easy parts of the public entryguard interface.Nick Mathewson
Here we add a little bit of state to origin circuits, and set up the necessary functions for the circuit code to call in order to find guards, use guards, and decide when circuits can be used. There's also an incomplete function for the hard part of the circuit-maintenance code, where we figure out whether any waiting guards are ready to become usable. (This patch finally uses the handle.c code to make safe handles to entry_guard_t objects, so that we are allowed to free an entry_guard_t without checking whether any origin_circuit_t is holding a reference to it.)
2016-11-04Merge branch 'ticket17238_029_02-resquash'Nick Mathewson
Conflicts: src/or/rendclient.c src/or/rendcommon.c src/or/routerparse.c src/test/test_dir.c src/trunnel/ed25519_cert.h
2016-11-04hs: Refactor rend_data_t for multi version supportDavid Goulet
In order to implement proposal 224, we need the data structure rend_data_t to be able to accomodate versionning that is the current version of hidden service (2) and the new version (3) and future version. For that, we implement a series of accessors and a downcast function to get the v2 data structure. rend_data_t becomes a top level generic place holder. The entire rend_data_t API has been moved to hs_common.{c|h} in order to seperate code that is shared from between HS versions and unshared code (in rendcommon.c). Closes #19024 Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-10-26More module documentation (circpathbias, circuitlist)Nick Mathewson
2016-09-22Merge branch 'maint-0.2.8'Nick Mathewson
2016-09-22Merge branch 'bug20203_027_squashed' into maint-0.2.8Nick Mathewson
2016-09-22When clearing cells from a circuit for OOM reasons, tell cmux we did so.Nick Mathewson
Not telling the cmux would sometimes cause an assertion failure in relay.c when we tried to get an active circuit and found an "active" circuit with no cells. Additionally, replace that assert with a test and a log message. Fix for bug 20203. This is actually probably a bugfix on 0.2.8.1-alpha, specifically my code in 8b4e5b7ee902fb7fa0776 where I made circuit_mark_for_close_() do less in order to simplify our call graph. Thanks to "cypherpunks" for help diagnosing.
2016-08-29Merge remote-tracking branch 'teor/reject-tap-v6'Nick Mathewson
2016-08-24Improve comments in circuit_get_cpath_*teor (Tim Wilson-Brown)
2016-07-19Use coarse monotonic timer instead of cached monotonized libevent time.Nick Mathewson
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-28Fix my dumb unreleased bug in 18673Nick Mathewson
2016-03-28Fix memory leak in TestingEnableCellStatsEventNick Mathewson
Only when we were actually flushing the cell stats to a controller would we free them. Thus, they could stay in RAM even after the circuit was freed (eg if we didn't have any controllers). Fixes bug 18673; bugfix on 0.2.5.1-alpha.
2016-02-27Update the copyright year.Nick Mathewson
2016-02-27Make sure that every module in src/or has a brief description.Nick Mathewson
2016-02-11Rename circuit_about_to_free_{terminal -> atexit}Nick Mathewson
2016-02-10Properly detach circuits from cmuxes when calling circuit_free_all() on ↵Andrea Shepard
shutdown again
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-12-08Fix memory leak by circuit marked for close listcypherpunks
This commit fixes a memory leak introduced by commit 8b4e5b7ee902fb7fa07767410a18433d752c7aef.
2015-11-13appease check-spacesNick Mathewson
2015-11-12Experimentally decouple the main body of circuit_mark_for_closeNick Mathewson
2015-08-06Fix misnamed parameter in or_circuit_new docstring.Isis Lovecruft
* CHANGES `p_conn` to `p_chan` in `or_circuit_new()` docstring.
2015-02-17trivial whitespace fixRoger Dingledine
2015-02-11Remove mempools and buf freelistsNick Mathewson
They have been off-by-default since 0.2.5 and nobody has complained. :) Also remove the buf_shrink() function, which hasn't done anything since we first stopped using contiguous memory to store buffers. Closes ticket 14848.
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.