summaryrefslogtreecommitdiff
path: root/src/or/relay.c
AgeCommit message (Collapse)Author
2010-09-16I hear we are close to a release. Clean up the whitespace.Nick Mathewson
2010-09-16Demote a warn when enabling CellStatisticsSebastian Hahn
When the CellStatistics option is off, we don't store cell insertion times. Doing so would also not be very smart, because there seem to still be some performance issues with this type of statistics. Nothing harmful happens when we don't have insertion times, so we don't need to alarm the user.
2010-09-15Merge branch 'bug1184'Nick Mathewson
2010-09-15Never queue a cell on a marked circuitNick Mathewson
2010-09-14Add a simple integer-ceiling-division macro before we get it wrongNick Mathewson
2010-09-13Make circuit_resume_edge_reading_helper treat streams more fairly.Nick Mathewson
Previously[*], the function would start with the first stream on the circuit, and let it package as many cells as it wanted before proceeding to the next stream in turn. If a circuit had many live streams that all wanted to package data, the oldest would get preference, and the newest would get ignored. Now, we figure out how many cells we're willing to send per stream, and try to allocate them fairly. Roger diagnosed this in the comments for bug 1298. [*] This bug has existed since before the first-ever public release of Tor. It was added by r152 of Tor on 26 Jan 2003, which was the first commit to implement streams (then called "topics"). This is not the oldest bug to be fixed in 0.2.2.x: that honor goes to the windowing bug in r54, which got fixed in e50b7768 by Roger with diagnosis by Karsten. This is, however, the most long-lived bug to be fixed in 0.2.2.x: the r54 bug was fixed 2580 days after it was introduced, whereas I am writing this commit message 2787 days after r152.
2010-09-13Add a max_cells arg to connection_edge_process_raw_inbufNick Mathewson
I'm going to use this to implement more fairness in circuit_resume_edge_reading_helper in an attempt to fix bug 1298. (Updated with fixes from arma and Sebastian)
2010-09-13Fix function declaration linebreaks at start of relay.cNick Mathewson
2010-09-08be more consistent in using streamid_tNick Mathewson
2010-09-03Fix a missing stream_id argument; found by "tracktor"Nick Mathewson
2010-09-02Fix behavior of adding a cell to a blocked queue.Nick Mathewson
We frequently add cells to stream-blocked queues for valid reasons that don't mean we need to block streams. The most obvious reason is if the cell arrives over a circuit rather than from an edge: we don't block circuits, no matter how full queues get. The next most obvious reason is that we allow CONNECTED cells from a newly created stream to get delivered just fine. This patch changes the behavior so that we only iterate over the streams on a circuit when the cell in question came from a stream, and we only block the stream that generated the cell, so that other streams can still get their CONNECTEDs in.
2010-08-18Detect if we try to put a cell onto a supposedly blocked cell queue.Nick Mathewson
When this happens, run through the streams on the circuit and make sure they're all blocked. If some aren't, that's a bug: block them all and log it! If they all are, where did the cell come from? Log it! (I suspect that this actually happens pretty frequently, so I'm making these log messages appear at INFO.)
2010-08-18Decide whether to ignore SENDMEs based on streams_blocked, not queue sizeNick Mathewson
2010-08-18Avoid over-filling cell queues when we receive a SENDMEyetonetime
Do not start reading on exit streams when we get a SENDME unless we have space in the appropriate circuit's cell queue. Draft fix for bug 1653. (commit message by nickm)
2010-08-16161b2750 didn't really retry the stream. this does.Roger Dingledine
2010-08-15Merge commit 'sebastian/bug1831'Nick Mathewson
2010-08-15Merge commit 'sebastian/misc-reason'Nick Mathewson
2010-08-16Fix misplaced labelsSebastian Hahn
2010-08-04Retry streams that ended with NOROUTE errorSebastian Hahn
Also add the NOROUTE reason to control-spec.
2010-07-30Clear cell queues when marking or truncating a circuit.Nick Mathewson
At best, this patch helps us avoid sending queued relayed cells that would get ignored during the time between when a destroy cell is sent and when the circuit is finally freed. At worst, it lets us release some memory a little earlier than it would otherwise. Fix for bug #1184. Bugfix on 0.2.0.1-alpha.
2010-07-27Create routerparse.hSebastian Hahn
2010-07-27Create relay.hSebastian Hahn
2010-07-27Create reasons.hSebastian Hahn
2010-07-27Create policies.hSebastian Hahn
2010-07-27Create networkstatus.hSebastian Hahn
2010-07-27Create main.hSebastian Hahn
2010-07-27Create control.hSebastian Hahn
2010-07-27Create connection_or.hSebastian Hahn
2010-07-27Create connection_edge.hSebastian Hahn
2010-07-27Create connection.hSebastian Hahn
2010-07-27Create config.hSebastian Hahn
2010-07-27Create circuitlist.hSebastian Hahn
2010-07-27Create circuitbuild.hSebastian Hahn
2010-07-27Create buffers.hSebastian Hahn
2010-07-27Create rendcommon.hSebastian Hahn
2010-07-27Create routerlist.hSebastian Hahn
2010-07-27Create geoip.hSebastian Hahn
2010-04-13Rename CircPriorityHalflifeMsec to CircuitPriorityHalflifeMsecNick Mathewson
Everything that accepted the 'Circ' name handled it wrong, so even now that we fixed the handling of the parameter, we wouldn't be able to set it without making all the 0.2.2.7..0.2.2.10 relays act wonky. This patch makes Tors accept the 'Circuit' name instead, so we can turn on circuit priorities without confusing the versions that treated the 'Circ' name as occasion to act weird.
2010-04-12Fix a bug in reading CircPriorityHalflife from consensusNick Mathewson
When you mean (a=b(c,d)) >= 0, you had better not say (a=b(c,d)>=0). We did the latter, and so whenever CircPriorityHalflife was in the consensus, it was treated as having a value of 1 msec (that is, boolean true).
2010-02-27Merge remote branch 'origin/maint-0.2.1'Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2010-02-27Update Tor Project copyright yearsNick Mathewson
2009-12-15Change interface for configuring cell ewma algorithm.Nick Mathewson
The rule is now: take the value from the CircuitPriorityHalflife config option if it is set. If it zero, disable the cell_ewma algorithm. If it is set, use it to calculate the scaling factor. If it is not set, look for a CircPriorityHalflifeMsec parameter in the consensus networkstatus. If *that* is zero, then disable the cell_ewma algorithm; if it is set, use it to calculate the scaling factor. If it is not set at all, disable the algorithm.
2009-12-15Merge commit 'sebastian/ewma2' into ewmaNick Mathewson
Conflicts: src/or/relay.c
2009-12-15Fix various comment typos in ewma patch; found by arma.Nick Mathewson
2009-12-14Fix Snow Leopard compile and a codestyle violationSebastian Hahn
When calculating the current tick, cap (tv_sec / EWMA_TICK_LEN) to an unsigned int.
2009-12-13Optimize cell-ewma circuit priority algorithm.Nick Mathewson
There are two big changes here: - We store active circuits in a priority queue for each or_conn, rather than doing a linear search over all the active circuits before we send each cell. - Rather than multiplying every circuit's cell-ewma by a decay factor every time we send a cell (thus normalizing the value of a current cell to 1.0 and a past cell to alpha^t), we instead only scale down the cell-ewma every tick (ten seconds atm), normalizing so that a cell sent at the start of the tick has value 1.0).
2009-12-12Adjust EWMA patch to conform to whitespace style.Nick Mathewson
2009-12-12Favor quiet circuits when choosing which order to relay cells in.Can Tang
Each circuit is ranked in terms of how many cells from it have been relayed recently, using a time-weighted average. This patch has been tested this on a private Tor network on PlanetLab, and gotten improvements of 12-35% in time it takes to fetch a small web page while there's a simultaneous large data transfer going on simultaneously. [Commit msg by nickm based on mail from Ian Goldberg.]
2009-12-12*_free functions now accept NULLSebastian Hahn
Some *_free functions threw asserts when passed NULL. Now all of them accept NULL as input and perform no action when called that way. This gains us consistence for our free functions, and allows some code simplifications where an explicit null check is no longer necessary.
2009-11-22add a minimum for CircuitStreamTimeout, plus a man pageRoger Dingledine
plus some other unrelated touchups that have been sitting in my sandbox