summaryrefslogtreecommitdiff
path: root/src/or/relay.c
AgeCommit message (Collapse)Author
2014-08-24Merge branch 'bug11792_1_squashed'Nick Mathewson
Conflicts: src/or/circuitlist.c
2014-08-24Count zlib buffer memory towards OOM totals.Nick Mathewson
Part of 11792. (Uses the zlib-endorsed formula for memory needs for inflate/deflate from "zconf.h".)
2014-08-20Merge branch 'bug10116_squashed'Nick Mathewson
2014-08-20Merge remote-tracking branch 'public/bug12700_024'Nick Mathewson
2014-08-18Fix relay_command_to_string(); solve 12700.Nick Mathewson
Two bugs here: 1) We didn't add EXTEND2/EXTENDED2 to relay_command_to_string(). 2) relay_command_to_string() didn't log the value of unrecognized commands. Both fixed here.
2014-08-15Autoconvert most circuit-list iterations to smartlist iterationsNick Mathewson
Breaks compilation. Used this coccinelle script: @@ identifier c; typedef circuit_t; iterator name TOR_LIST_FOREACH; iterator name SMARTLIST_FOREACH_BEGIN; statement S; @@ - circuit_t *c; ... - TOR_LIST_FOREACH(c, \(&global_circuitlist\|circuit_get_global_list()\), head) + SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, c) S + SMARTLIST_FOREACH_END(c);
2014-06-14Merge branch 'bug12184_diagnostic_squashed'Nick 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-06-11Merge remote-tracking branch 'public/not_bug8093'Nick Mathewson
2014-06-04Bulletproof our 11246 fix a little, based on recommendation from andrea.Nick Mathewson
2014-06-01Use uint32 !=, not tor_memneq, for relay cell integrity checkingNick Mathewson
tor_memeq has started to show up on profiles, and this is one of the most frequent callers of that function, appearing as it does on every cell handled for entry or exit. 59f9097d5c3dc010847c359888d31757d1c97904 introduced tor_memneq here; it went into Tor 0.2.1.31. Fixes part of 12169.
2014-05-21Eliminate #ifdef ENABLE_MEMPOOLS in packed_cell_new/free()Andrea Shepard
2014-05-12Add --disable-mempools configure optionAndrea Shepard
2014-04-02Unit tests for connection_edge_process_resolved_cellNick Mathewson
Also rename a function to be more accurate (resolve->resolved)
2014-04-02Look at all of a RESOLVED cell; not just the first answer.Nick Mathewson
Also, stop accepting the old kind of RESOLVED cells with no TTL fields; they haven't been sent since 0.1.1.6-alpha. This patch won't work without the fix to #10468 -- it will break DNSPorts unless they set the proper ipv4/6 flags on entry_connection_t.
2014-04-01Extract code to handle RESOLVED cellsNick Mathewson
No other changes have been made; only code has been moved.
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-03-04Merge branch 'bug10169_025_v2'Nick Mathewson
Conflicts: src/test/test.c
2014-03-04Merge remote-tracking branch 'public/bug10169_024' into bug10169_025_v2Nick Mathewson
Conflicts: src/common/compat_libevent.h src/or/relay.c
2014-03-04Merge remote-tracking branch 'public/bug10169_023' into bug10169_024Nick Mathewson
Conflicts: src/or/relay.c
2014-02-26Monotonize the OOM-killer data timersNick Mathewson
In a couple of places, to implement the OOM-circuit-killer defense against sniper attacks, we have counters to remember the age of cells or data chunks. These timers were based on wall clock time, which can move backwards, thus giving roll-over results for our age calculation. This commit creates a low-budget monotonic time, based on ratcheting gettimeofday(), so that even in the event of a time rollback, we don't do anything _really_ stupid. A future version of Tor should update this function to do something even less stupid here, like employ clock_gettime() or its kin.
2014-02-25Merge remote-tracking branch 'public/no_itime_queue' into maint-0.2.4Nick Mathewson
2014-02-12Refactor OOM-handling functions for more testabilityNick Mathewson
This patch splits out some of the functions in OOM handling so that it's easier to check them without involving the rest of Tor or requiring that the circuits be "wired up".
2014-02-12Merge remote-tracking branch 'public/bug10169_024' into bug10169_025_v2Nick Mathewson
Conflicts: src/or/circuitlist.c
2014-02-11Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2014-02-10Merge remote-tracking branch 'public/no_itime_queue'Nick Mathewson
The conflicts here were tricky, and required me to eliminate the command-queue as well. That wasn't so hard. Conflicts: src/or/or.h src/or/relay.c
2014-02-10Excise the insertion_time_elem_t logicNick Mathewson
It's now redundant with the inserted_time field in packed_cell_t Fixes bug 10870.
2014-02-09Don't treat END_STREAM_REASON_INTERNAL as total circuit failureNick Mathewson
It can happen because we sent something that got an ENETUNREACH response. Bugfix on 0.2.4.8-alpha; fixes a part of bug 10777.
2014-01-03Merge remote-tracking branch 'public/bug10169_023' into bug10169_024Nick Mathewson
Conflicts: doc/tor.1.txt src/or/config.c src/or/or.h The conflicts were all pretty trivial.
2013-11-20Rename MaxMemInCellQueues to MaxMemInQueuesNick Mathewson
2013-11-18Remove 'struct timeval now' that was shadowing 'struct timeval now'.Nick Mathewson
This was a mistake in the merge commit 7a2b30fe16eacc040b3dd11. It would have made the CellStatistics code give completely bogus results. Bug not in any released Tor.
2013-11-15Have the OOM handler also count the age the data in a stream bufferNick Mathewson
2013-11-15Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
Conflicts: src/or/relay.c Conflict changes were easy; compilation fixes required were using using TOR_SIMPLEQ_FIRST to get head of cell queue.
2013-11-15Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/or.h src/or/relay.c Conflicts were simple to resolve. More fixes were needed for compilation, including: reinstating the tv_to_msec function, and renaming *_conn_cells to *_chan_cells.
2013-11-07Improved circuit queue out-of-memory handlerNick Mathewson
Previously, when we ran low on memory, we'd close whichever circuits had the most queued cells. Now, we close those that have the *oldest* queued cells, on the theory that those are most responsible for us running low on memory, and that those are the least likely to actually drain on their own if we wait a little longer. Based on analysis from a forthcoming paper by Jansen, Tschorsch, Johnson, and Scheuermann. Fixes bug 9093.
2013-10-31Add missing includes for circpathbias.hNick Mathewson
2013-10-30Add some clarity and checks to cell_queue_append_packed_copyNick Mathewson
It's not cool to have "circ may be NULL if use_stats false, but otherwise we crash" as an undocumented API constraint. :)
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-10-08Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
Conflicts: src/or/relay.c
2013-10-08don't lie about bootstrap progress when clients use bridgesRoger Dingledine
we were listing 50% as soon as we got a bridge's relay descriptor, even if we didn't have any consensus, certificates, etc yet.
2013-10-08Generate bootstrapping status messages for microdescs tooNick Mathewson
Fix for 9927.
2013-08-15Rename circuit_get_global_list to remove trailing _Nick Mathewson
2013-08-15Merge remote-tracking branch 'majek/bug9108'Nick Mathewson
Conflicts: src/or/circuitlist.h
2013-07-18Unit tests for cell queues.Nick Mathewson
This removes some INLINE markers from functions that probably didn't need them.
2013-07-18Use TOR_SIMPLEQ for packed_cell_tNick Mathewson
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-06-20Fix #9108 - make global_circuitlist a doubly linked listMarek Majkowski
2013-06-18Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-06-18Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/config.c src/or/relay.c
2013-06-18Implement a real OOM-killer for too-long circuit queues.Nick Mathewson
This implements "algorithm 1" from my discussion of bug #9072: on OOM, find the circuits with the longest queues, and kill them. It's also a fix for #9063 -- without the side-effects of bug #9072. The memory bounds aren't perfect here, and you need to be sure to allow some slack for the rest of Tor's usage. This isn't a perfect fix; the rest of the solutions I describe on codeable.