summaryrefslogtreecommitdiff
path: root/src/or/channel.c
AgeCommit message (Collapse)Author
2018-01-30test: Add unit tests for the DoS subsystemGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-30dos: Track new and closed OR client connectionsDavid Goulet
Implement a basic connection tracking that counts the number of concurrent connections when they open and close. This commit also adds the circuit creation mitigation data structure that will be needed at later commit to keep track of the circuit rate. Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-10-18Module docs for channel.c and channeltls.cNick Mathewson
2016-09-06checkSpace.pl now forbids more identifiers.Nick Mathewson
The functions it warns about are: assert, memcmp, strcat, strcpy, sprintf, malloc, free, realloc, strdup, strndup, calloc. Also, fix a few lingering instances of these in the code. Use other conventions to indicate _intended_ use of assert and malloc/realloc/etc.
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-06-11Add the -Wextra-semi warning from clang, and fix the cases where it triggersNick Mathewson
2016-06-11Use -Wdouble-promotion in GCC >= 4.6Nick Mathewson
This warning triggers on silently promoting a float to a double. In our code, it's just a sign that somebody used a float by mistake, since we always prefer double.
2016-06-11Add -Wfloat-conversion for GCC >= 4.9Nick Mathewson
This caught quite a few minor issues in our unit tests and elsewhere in our code.
2016-03-28Rename tor_dup_addr to tor_addr_to_str_dup.Nick Mathewson
Patch from icanhasaccount; closes 18462.
2016-03-26Do not treat "DOCDOC" as doxygen.Nick Mathewson
2016-03-21Merge branch 'bug18570_027'Nick Mathewson
2016-03-21Make sure channel_t queues its own copy of incoming cellsAndrea Shepard
2016-02-27Update the copyright year.Nick Mathewson
2016-02-27Make sure that every module in src/or has a brief description.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-09-01properly delete current channel in channel_free_listSebastian Hahn
channel_unregister() removes channels from the current smartlist while we're in a SMORTLIST_FOREACH loop. This only works by accident.
2015-05-28Tests for AUTHENTICATE cell functionality.Nick Mathewson
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