aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
AgeCommit message (Collapse)Author
2010-10-15Fold timestamp_created into highres_createdNick Mathewson
There's no reason to keep a time_t and a struct timeval to represent the same value: highres_created.tv_sec was the same as timestamp_created. This should save a few bytes per circuit.
2010-10-04Fix a couple more node_t-related nullpointer bugsNick Mathewson
2010-10-01Initial conversion to use node_t throughout our codebase.Nick Mathewson
A node_t is an abstraction over routerstatus_t, routerinfo_t, and microdesc_t. It should try to present a consistent interface to all of them. There should be a node_t for a server whenever there is * A routerinfo_t for it in the routerlist * A routerstatus_t in the current_consensus. (note that a microdesc_t alone isn't enough to make a node_t exist, since microdescriptors aren't usable on their own.) There are three ways to get a node_t right now: looking it up by ID, looking it up by nickname, and iterating over the whole list of microdescriptors. All (or nearly all) functions that are supposed to return "a router" -- especially those used in building connections and circuits -- should return a node_t, not a routerinfo_t or a routerstatus_t. A node_t should hold all the *mutable* flags about a node. This patch moves the is_foo flags from routerinfo_t into node_t. The flags in routerstatus_t remain, but they get set from the consensus and should not change. Some other highlights of this patch are: * Looking up routerinfo and routerstatus by nickname is now unified and based on the "look up a node by nickname" function. This tries to look only at the values from current consensus, and not get confused by the routerinfo_t->is_named flag, which could get set for other weird reasons. This changes the behavior of how authorities (when acting as clients) deal with nodes that have been listed by nickname. * I tried not to artificially increase the size of the diff here by moving functions around. As a result, some functions that now operate on nodes are now in the wrong file -- they should get moved to nodelist.c once this refactoring settles down. This moving should happen as part of a patch that moves functions AND NOTHING ELSE. * Some old code is now left around inside #if 0/1 blocks, and should get removed once I've verified that I don't want it sitting around to see how we used to do things. There are still some unimplemented functions: these are flagged with "UNIMPLEMENTED_NODELIST()." I'll work on filling in the implementation here, piece by piece. I wish this patch could have been smaller, but there did not seem to be any piece of it that was independent from the rest. Moving flags forces many functions that once returned routerinfo_t * to return node_t *, which forces their friends to change, and so on.
2010-10-01Try to make most routerinfo_t interfaces constNick Mathewson
2010-09-29Merge branch 'bug1772' into maint-0.2.2Roger Dingledine
2010-09-29no measurement circs if not enough build timesRoger Dingledine
In the first 100 circuits, our timeout_ms and close_ms are the same. So we shouldn't transition circuits to purpose CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT, since they will just timeout again next time we check.
2010-09-29refactor and recomment; no actual changesRoger Dingledine
2010-09-29Merge commit 'mikeperry/bug1739' into maint-0.2.2Roger Dingledine
2010-09-29Merge commit 'mikeperry/bug1740' into maint-0.2.2Roger Dingledine
2010-09-29Fix non-live condition checks.Mike Perry
Rechecking the timeout condition was foolish, because it is checked on the same codepath. It was also wrong, because we didn't round. Also, the liveness check itself should be <, and not <=, because we only have 1 second resolution.
2010-09-29Send control port events for timeouts.Mike Perry
We now differentiate between timeouts and cutoffs by the REASON string and the PURPOSE string.
2010-09-29Only count timeout data for 3 hop circuits.Mike Perry
Use 4/3 of this timeout value for 4 hop circuits, and use half of it for canabalized circuits.
2010-09-28improve code comments, based on comments from nickRoger Dingledine
2010-09-28handle ugly edge case in retrying entrynodesRoger Dingledine
Specifically, a circ attempt that we'd launched while the network was down could timeout after we've marked our entrynodes up, marking them back down again. The fix is to annotate as bad the OR conns that were around before we did the retry, so if a circuit that's attached to them times out we don't do anything about it.
2010-09-28optimistically retry EntryNodes on socks requestRoger Dingledine
We used to mark all our known bridges up when they're all down and we get a new socks request. Now do that when we've set EntryNodes too.
2010-08-14fix another piece of 1741Roger Dingledine
2010-08-13changes entry for bug 1741Roger Dingledine
2010-08-13Add check for CIRCUIT_PURPOSE_S_REND_JOINED.Mike Perry
These circuits stick around much longer than others on the server side for performance reasons. Their lifetime is controlled by the client.
2010-08-09tiny changes i found in my sandboxRoger Dingledine
2010-07-31Bug #1222: Clarify new circuit after sleep noticeChris Ball
("Application request when we're believed to be offline." -> "Application request when we haven't used client functionality lately.")
2010-07-27Create rephist.hSebastian Hahn
2010-07-27Create policies.hSebastian Hahn
2010-07-27Create control.hSebastian Hahn
2010-07-27Create connection_edge.hSebastian Hahn
2010-07-27Create connection.hSebastian Hahn
2010-07-27Create config.hSebastian Hahn
2010-07-27Create circuituse.hSebastian Hahn
2010-07-27Create circuitlist.hSebastian Hahn
2010-07-27Create circuitbuild.hSebastian Hahn
2010-07-27Create rendservice.hSebastian Hahn
2010-07-27Create rendclient.hSebastian Hahn
2010-07-27Create rendcommon.hSebastian Hahn
2010-07-27Create routerlist.hSebastian Hahn
2010-07-27Create router.hSebastian Hahn
2010-06-29Fix bugs with assuming time_t can be implicitly cast to longNick Mathewson
Many friendly operating systems have 64-bit times, and it's not nice to pass them to an %ld format. It's also extremely not-nice to write a time to the log as an integer. Most people think it's 2010 June 29 23:57 UTC+epsilon, not 1277855805+epsilon.
2010-06-16Mention the purpose field for leaked circuits.Mike Perry
2010-06-15Be more proactive about closing unused circuits.Mike Perry
We need to ensure that we close timeout measurement circuits. While we're at it, we should close really old circuits of certain types that aren't in use, and log really old circuits of other types.
2010-06-15Split the circuit timeout and close codepaths.Mike Perry
We need to record different statistics at point of timeout, vs the point of forcible closing. Also, give some better names to constants and state file variables to indicate they are not dealing with timeouts, but abandoned circuits.
2010-06-15Fix initialization and reset issues with close_ms.Mike Perry
Also clean up some log messages.
2010-06-09Keep circuits open until the greater of 95th CDF percentile or 60s.Mike Perry
This is done to provide better data to our right-censored Pareto model. We do this by simply marking them with a new purpose.
2010-05-10Bug 1245: Ignore negative and large timeouts.Mike Perry
This should prevent some asserts and storage of incorrect build times for the cases where Tor is suspended during a circuit construction, or just after completing a circuit. The idea is that if the circuit build time is much greater than we would have cut it off at, we probably had a suspend event along this codepath, and we should discard the value.
2010-04-23Merge branch 'maint-0.2.1'Roger Dingledine
2010-04-23close idle dir-fetch circs earlyRoger Dingledine
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-21Be more willing to use an unsuitable circuit for exit.Roger Dingledine
Specifically, there are two cases: a) are we willing to start a new circuit at a node not in your ExitNodes config option, and b) are we willing to make use of a circuit that's already established but has an unsuitable exit. Now we discard all your circuits when you set ExitNodes, so the only way you could end up with an exit circuit that ends at an unsuitable place is if we explicitly ran out of exit nodes, StrictNodes was 0, and we built this circuit to solve a stream that needs solving. Fixes bug in dc322931, which would ignore the just-built circuit because it has an unsuitable exit.
2009-12-15Merge branch 'safelogging2'Nick Mathewson
Conflicts: ChangeLog
2009-12-15Refactor the safe_str_*() API to make more sense.Nick Mathewson
The new rule is: safe_str_X() means "this string is a piece of X information; make it safe to log." safe_str() on its own means "this string is a piece of who-knows-what; make it safe to log".
2009-12-12Now that FOO_free(NULL) always works, remove checks before calling it.Nick Mathewson
2009-09-20Fix typos and comments, plus two bugsRoger Dingledine
A) We were considering a circuit had timed out in the special cases where we close rendezvous circuits because the final rendezvous circuit couldn't be built in time. B) We were looking at the wrong timestamp_created when considering a timeout.