aboutsummaryrefslogtreecommitdiff
path: root/src/or/channel.c
AgeCommit message (Collapse)Author
2015-01-07When closing circs build through a new guard, only close local onesNick Mathewson
If we decide not to use a new guard because we want to retry older guards, only close the locally-originating circuits passing through that guard. Previously we would close all the circuits. Fixes bug 9819; bugfix on 0.2.1.1-alpha. Reported by "skruffy".
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-22Fix a bunch of memory leaks in the unit tests. Found with valgrindNick Mathewson
2014-12-21Merge branch 'ticket7356_squashed'Nick Mathewson
2014-12-21Use channel state lookup macros in channel.crl1987
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 channel_flush_some_cells() mockableAndrea Shepard
2014-09-30Make channel_dump_statistics() mockableAndrea Shepard
2014-09-30What the hell was I on?Andrea Shepard
2014-09-30Let channel unit tests mess with global queue estimateAndrea Shepard
2014-09-30Expose some channel cell queue stuff to the test suiteAndrea Shepard
2014-09-30Refactor channel_get_cell_queue_entry_size() to avoid an unreachable line ↵Andrea Shepard
for test coverage, and fix a nasty lurking memory bug in channel_flush_some_cells_from_outgoing_queue()
2014-09-30Eliminate some unnecessary smartlists in scheduler.cAndrea Shepard
2014-09-30Schedule according to a queue size heuristicAndrea Shepard
2014-09-30Fix return values from channel_flush_some_cells() to correctly count cells ↵Andrea Shepard
directly written by channel_flush_from_first_active_circuit()
2014-09-30Implement global queue size query in channel.cAndrea Shepard
2014-09-30Track total queue size per channel, with overhead estimates, and global ↵Andrea Shepard
queue total
2014-09-30Add global cell/byte counters and per channel byte counters to channel.cAndrea Shepard
2014-09-30Provide generic mechanism for scheduler to query writeable cells on a channelAndrea Shepard
2014-09-30Implement scheduler mechanism to track lists of channels wanting cells or ↵Andrea Shepard
writes; doesn't actually drive the cell flow from it yet
2014-09-09Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-09-05Correctly update channel local mark when address of incoming connection ↵Andrea Shepard
changes after handshake; fixes bug #12160
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-08-13Merge remote-tracking branch 'public/bug12848_024' into maint-0.2.5Nick Mathewson
Conflicts: src/or/circuitbuild.c
2014-08-12Add an extra check in channel_send_destroy for circID==0Nick Mathewson
Prevents other cases of 12848.
2014-07-24fix typo that crept in to 0.2.4.4-alphaRoger Dingledine
2014-07-18Use safe_str in channel_dumpstats: improve 12184 diagnosticNick Mathewson
2014-06-11Merge remote-tracking branch 'public/ticket6799_024_v2_squashed'Nick Mathewson
Conflicts: src/or/channel.c src/or/circuitlist.c src/or/connection.c Conflicts involved removal of next_circ_id and addition of unusable-circid tracking.
2014-06-11Replace last_added_nonpadding with last_had_circuitsNick Mathewson
The point of the "idle timeout" for connections is to kill the connection a while after it has no more circuits. But using "last added a non-padding cell" as a proxy for that is wrong, since if the last circuit is closed from the other side of the connection, we will not have sent anything on that connection since well before the last circuit closed. This is part of fixing 6799. When applied to 0.2.5, it is also a fix for 12023.
2014-04-23Merge remote-tracking branch 'public/bug11553_024' into bug11553_025Nick Mathewson
Conflicts: src/or/circuitbuild.c
2014-04-23Improvements to #11553 fix based on reviewNick Mathewson
Use a per-channel ratelim_t to control the rate at which we report failures for each channel. Explain why I picked N=32. Never return a zero circID. Thanks to Andrea and to cypherpunks.
2014-04-18Merge remote-tracking branch 'public/bug11553_024' into bug11553_025Nick Mathewson
Conflicts: src/or/channel.h
2014-04-18Switch to random allocation on circuitIDs.Nick Mathewson
Fixes a possible root cause of 11553 by only making 64 attempts at most to pick a circuitID. Previously, we would test every possible circuit ID until we found one or ran out. This algorithm succeeds probabilistically. As the comment says: This potentially causes us to give up early if our circuit ID space is nearly full. If we have N circuit IDs in use, then we will reject a new circuit with probability (N / max_range) ^ MAX_CIRCID_ATTEMPTS. This means that in practice, a few percent of our circuit ID capacity will go unused. The alternative here, though, is to do a linear search over the whole circuit ID space every time we extend a circuit, which is not so great either. This makes new vs old clients distinguishable, so we should try to batch it with other patches that do that, like 11438.
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.
2014-02-12Siphash-2-4 is now our hash in nearly all cases.Nick Mathewson
I've made an exception for cases where I'm sure that users can't influence the inputs. This is likely to cause a slowdown somewhere, but it's safer to siphash everything and *then* look for cases to optimize. This patch doesn't actually get us any _benefit_ from siphash yet, since we don't really randomize the key at any point.
2013-10-02Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-10-02Fix a bug in our bug 9776 fix.Nick Mathewson
By calling circuit_n_chan_done() unconditionally on close, we were closing pending connections that might not have been pending quite for the connection we were closing. Fix for bug 9880. Thanks to skruffy for finding this and explaining it patiently until we understood.
2013-09-24Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-09-24Always call circuit_n_chan_done(chan, 0) from channel_closed()Andrea Shepard
2013-08-22Separate mutable/const accessors for circuit_build_timesNick Mathewson
(These have proved invaluable for other global accessors.)
2013-08-22Make circ_times static and add accessor functions.vagrant
Change the global circ_times to a static variable and use accessor functions throughout the code, instead of accessing it directly.
2013-08-15Merge branch 'bug5040_4773_rebase_3'Nick Mathewson
2013-07-23Fix bug9309, and n_noncanonical count/continue codeNick Mathewson
When we moved channel_matches_target_addr_for_extend() into a separate function, its sense was inverted from what one might expect, and we didn't have a ! in one place where we should have. Found by skruffy.
2013-07-23Fix bug9309, and n_noncanonical count/continue codeNick Mathewson
When we moved channel_matches_target_addr_for_extend() into a separate function, its sense was inverted from what one might expect, and we didn't have a ! in one place where we should have. Found by skruffy.
2013-07-18Make a channel getter method to retrieve transport names.George Kadianakis
2013-07-18Add transport information to the GeoIP database.George Kadianakis
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-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.