aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
AgeCommit message (Collapse)Author
2014-09-21clients use optimistic data when reaching hidden servicesRoger Dingledine
Allow clients to use optimistic data when connecting to a hidden service, which should cut out the initial round-trip for client-side programs including Tor Browser. (Now that Tor 0.2.2.x is obsolete, all hidden services should support server-side optimistic data.) See proposal 181 for details. Implements ticket 13211.
2014-09-21Use optimistic data even if we don't know exitnode->rsRoger Dingledine
I think we should know the routerstatus for our exit relay, since we built a circuit to it. So I think this is just a code simplication.
2014-09-21get rid of routerstatus->version_supports_optimistic_dataRoger Dingledine
Clients are now willing to send optimistic circuit data (before they receive a 'connected' cell) to relays of any version. We used to only do it for relays running 0.2.3.1-alpha or later, but now all relays are new enough. Resolves ticket 13153.
2014-08-15Hand-fix a few global_circuit_list casesNick Mathewson
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-07-16Add another 8387 diagnosticNick Mathewson
When we run into bug 8387 (if we run into it again), report when we last called circuit_expire_old_circuits_clientside(). This will let us know -- if my fix for 8387 doesn't work -- whether my diagnosis was at least correct. Suggested by Andrea.
2014-07-16Merge remote-tracking branch 'public/bug8387_024' into maint-0.2.5Nick Mathewson
2014-07-09Fix a bug where streams would linger forever when we had no dirinfoNick Mathewson
fixes bug 8387; fix on 0.1.1.11-alpha (code), or on 0.2.4.10-alpha (behavior).
2014-06-11whitespaces fixesNick Mathewson
2014-06-10Improved diagnostic log for bug 8387.Nick Mathewson
When we find a stranded one-hop circuit, log whether it is dirty, log information about any streams on it, and log information about connections they might be linked to.
2014-05-11Quench clang's complaints with -Wshorten-64-to-32 when time_t is not long.dana koch
On OpenBSD 5.4, time_t is a 32-bit integer. These instances contain implicit treatment of long and time_t as comparable types, so explicitly cast to time_t.
2014-05-07Better log message for 8387 diagnosticNick Mathewson
2014-04-29Log info on ancient one-hop circuits in heartbeatNick Mathewson
This is an attempt to diagnose 8387.
2014-04-18scan-build: when logging a path length, check build_state.Nick Mathewson
Throughout circuituse, when we log about a circuit, we log its desired path length from build_state. scan-build is irrationally concerned that build_state might be NULL.
2014-04-15Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2014-04-15Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/circuituse.c
2014-04-14Don't send uninitialized stack to the controller and say it's a date.Nick Mathewson
Fixes bug 11519, apparently bugfix on 0.2.3.11-alpha.
2013-12-21Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-12-21Fix a logic error in circuit_stream_is_being_handled.Nick Mathewson
When I introduced the unusable_for_new_circuits flag in 62fb209d837f3f551, I had a spurious ! in the circuit_stream_is_being_handled loop. This made us decide that non-unusable circuits (that is, usable ones) were the ones to avoid, and caused it to launch a bunch of extra circuits. Fixes bug 10456; bugfix on 0.2.4.12-alpha.
2013-11-01Merge branch 'prop221_squashed_024'Nick Mathewson
Conflicts: src/or/or.h
2013-11-01circuit_build_failed: distinguish "got DESTROY" caseNick Mathewson
Roger spotted this on tor-dev in his comments on proposal 221. We etect DESTROY vs everything else, since arma likes network timeout indicating failure but not overload indicating failure.
2013-10-31Add missing includes for circpathbias.hNick Mathewson
2013-09-29fix two cases where we were printing unsigned int as %dRoger Dingledine
2013-09-04Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
Conflicts: src/or/circuituse.c
2013-09-04Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/circuitbuild.c
2013-09-04use !cbt_disabled in place of LearnCBT to avoid needless circsNick Mathewson
This would make us do testing circuits "even when cbt is disabled by consensus, or when we're a directory authority, or when we've failed to write cbt history to our state file lately." (Roger's words.) This is a fix for 9671 and an improvement in our fix for 5049. The original misbehavior was in 0.2.2.14-alpha; the incomplete fix was in 0.2.3.17-beta.
2013-08-22Separate mutable/const accessors for circuit_build_timesNick Mathewson
(These have proved invaluable for other global accessors.)
2013-08-22Rename get_circuit_nbuild_* to end with _msNick Mathewson
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-15Rename circuit_get_global_list to remove trailing _Nick Mathewson
2013-06-20Fix #9108 - make global_circuitlist a doubly linked listMarek Majkowski
2013-06-20Don't access global_circuitlist variable directly. Use a getter instead.Marek Majkowski
2013-03-29Don't relax the timeout for already opened 1-hop circuits.Mike Perry
2013-03-29Add detail to log messages related to bug 7799.Mike Perry
Note this does not solve bug 7799, it is only to help us diagnose it.
2013-03-26Bug 6572: Use timestamp_created for liveness sanity checks.Mike Perry
This should eliminate potential regressions caused by #7341.
2013-03-20Fix an EOL@EOF in circuituse.cAndrea Shepard
2013-03-19Merge branch 'bug7582_v2' into maint-0.2.4Nick Mathewson
2013-03-18Merge remote-tracking branch 'public/bug6174' into maint-0.2.4Nick Mathewson
2013-03-11On END_REASON_EXITPOLICY, mark circuit as unusable for that address.Nick Mathewson
Also, don't call the exit node 'reject *' unless our decision to pick that node was based on a non-summarized version of that node's exit policy. rransom and arma came up with the ideas for this fix. Fix for 7582; the summary-related part is a bugfix on 0.2.3.2-alpha.
2013-03-10Fix 8447: use %u to format circid_t.Nick Mathewson
Now that circid_t is 4 bytes long, the default integer promotions will leave it alone when sizeof(int) == 4, which will leave us formatting an unsigned as an int. That's technically undefined behavior. Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not in any released Tor.
2013-02-19Stop frobbing timestamp_dirty as our sole means to mark circuits unusableNick Mathewson
In a number of places, we decrement timestamp_dirty by MaxCircuitDirtiness in order to mark a stream as "unusable for any new connections. This pattern sucks for a few reasons: * It is nonobvious. * It is error-prone: decrementing 0 can be a bad choice indeed. * It really wants to have a function. It can also introduce bugs if the system time jumps backwards, or if MaxCircuitDirtiness is increased. So in this patch, I add an unusable_for_new_conns flag to origin_circuit_t, make it get checked everywhere it should (I looked for things that tested timestamp_dirty), and add a new function to frob it. For now, the new function does still frob timestamp_dirty (after checking for underflow and whatnot), in case I missed any cases that should be checking unusable_for_new_conns. Fixes bug 6174. We first used this pattern in 516ef41ac1fd26f338c, which I think was in 0.0.2pre26 (but it could have been 0.0.2pre27).
2013-02-07Merge remote-tracking branch 'public/easy_ratelim'Nick Mathewson
Conflicts: src/or/connection.c
2013-02-01Clarify state transition and related pathbias commentsMike Perry
2013-01-20Prevent early close of path bias testing circuits.Mike Perry
We need to let them live long enough to perform the test.
2013-01-18Don't immediately count cannibalized circs as used.Mike Perry
Since they use RELAY_EARLY (which can be seen by all hops on the path), it's not safe to say they actually count as a successful use. There are also problems with trying to allow them to finish extending due to the circuit purpose state machine logic. It is way less complicated (and possibly more semantically coherent) to simply wait until we actually try to do something with them before claiming we 'used' them. Also, we shouldn't call timed out circuits 'used' either, for semantic consistency.
2013-01-18Implement Path use bias accounting.Mike Perry
Path use bias measures how often we can actually succeed using the circuits we actually try to use. It is a subset of path bias accounting, but it is computed as a separate statistic because the rate of client circuit use may vary depending on use case.
2013-01-16Aftermath of isin->contains renamingNick Mathewson
Fix wide lines and comments, and add a changes file
2013-01-16Rename *_isin to *_containsNick Mathewson
This is an automatically generated commit, from the following perl script, run with the options "-w -i -p". s/smartlist_string_num_isin/smartlist_contains_int_as_string/g; s/smartlist_string_isin((?:_case)?)/smartlist_contains_string$1/g; s/smartlist_digest_isin/smartlist_contains_digest/g; s/smartlist_isin/smartlist_contains/g; s/digestset_isin/digestset_contains/g;
2013-01-16Update the copyright date to 201.Nick Mathewson
2013-01-15Clean up odds and endsRoger Dingledine