aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
Commit message (Expand)AuthorAge
* Fix names of functions that convert strings to addrs•••Now let's have "lookup" indicate that there can be a hostname resolution, and "parse" indicate that there wasn't. Previously, we had one "lookup" function that did resolution; four "parse" functions, half of which did resolution; and a "from_str()" function that didn't do resolution. That's confusing and error-prone! The code changes in this commit are exactly the result of this perl script, run under "perl -p -i.bak" : s/tor_addr_port_parse/tor_addr_port_lookup/g; s/parse_addr_port(?=[^_])/addr_port_lookup/g; s/tor_addr_from_str/tor_addr_parse/g; This patch leaves aton and pton alone: their naming convention and behavior is is determined by the sockets API. More renaming may be needed. Nick Mathewson2011-10-11
* Fix compilation of 3335 and 3825 fixes•••In master, they ran into problems with the edge_conn/entry_conn split. Nick Mathewson2011-10-03
* Merge remote-tracking branch 'rransom-tor/bug3335-v2'•••Conflicts: src/or/connection_edge.c src/or/rendclient.c Nick Mathewson2011-10-03
|\
| * Clear the timed_out flag when an HS connection attempt endsRobert Ransom2011-10-02
* | Move entry-only fields from edge_connection_t to entry_connection_t•••Also, refactor the code accordingly. Nick Mathewson2011-07-21
* | remember our future plan for bug 3617•••(that is, to change the default for "UseOptimisticData auto" to 1 once we are more convinced that it works correctly.) Roger Dingledine2011-07-21
* | Add another precondition for isolation-clearing; fix 3620Nick Mathewson2011-07-20
* | For accuracy, s/exit_allows_optimistic_data/may_use_optimistic_data/Nick Mathewson2011-07-20
* | Add an OptimisticData option to control client-side optimistic dataNick Mathewson2011-07-20
* | Merge branch 'optimistic-client'•••The conflicts are with the proposal 171 circuit isolation code, and they're all trivial: they're just a matter of both branches adding some unrelated code in the same places. Conflicts: src/or/circuituse.c src/or/connection.c Nick Mathewson2011-07-20
|\ \
| * | Only use optimistic data with exits that support it•••This adds a little code complexity: we need to remember for each node whether it supports the right feature, and then check for each connection whether it's exiting at such a node. We store this in a flag in the edge_connection_t, and set that flag at link time. Nick Mathewson2011-07-18
* | | Take a smarter approach to clearing isolation info•••Back when I added this logic in 20c0581a79, the rule was that whenever a circuit finished building, we cleared its isolation info. I did that so that we would still use the circuit even if all the streams that had previously led us to tentatively set its isolation info had closed. But there were problems with that approach: We could pretty easily get into a case where S1 had led us to launch C1 and S2 had led us to launch C2, but when C1 finished, we cleared its isolation and attached S2 first. Since C2 was still marked in a way that made S1 unattachable to it, we'd then launch another circuit needlessly. So instead, we try the following approach now: when a circuit is done building, we try to attach streams to it. If it remains unused after we try attaching streams, then we clear its isolation info, and try again to attach streams. Thanks to Sebastian for helping me figure this out. Nick Mathewson2011-07-19
* | | Add an option to limit the number of non-open client circuits.•••This is mainly meant as a way to keep clients from accidentally DOSing themselves by (e.g.) enabling IsolateDestAddr or IsolateDestPort on a port that they use for HTTP. Nick Mathewson2011-07-19
* | | Launch sufficient circuits to satisfy pending isolated streams•••Our old "do we need to launch a circuit for stream S" logic was, more or less, that if we had a pending circuit that could handle S, we didn't need to launch a new one. But now that we have streams isolated from one another, we need something stronger here: It's possible that some pending C can handle either S1 or S2, but not both. This patch reuses the existing isolation logic for a simple solution: when we decide during circuit launching that some pending C would satisfy stream S1, we "hypothetically" mark C as though S1 had been connected to it. Now if S2 is incompatible with S1, it won't be something that can attach to C, and so we'll launch a new stream. When the circuit becomes OPEN for the first time (with no streams attached to it), we reset the circuit's isolation status. I'm not too sure about this part: I wanted some way to be sure that, if all streams that would have used a circuit die before the circuit is done, the circuit can still get used. But I worry that this approach could also lead to us launching too many circuits. Careful thought needed here. Nick Mathewson2011-07-19
* | | Implement stream isolation•••This is the meat of proposal 171: we change circuit_is_acceptable() to require that the connection is compatible with every connection that has been linked to the circuit; we update circuit_is_better to prefer attaching streams to circuits in the way that decreases the circuits' usefulness the least; and we update link_apconn_to_circ() to do the appropriate bookkeeping. Nick Mathewson2011-07-19
* | | Const-ify a few functionsNick Mathewson2011-07-19
|/ /
* | Remove compare_addr_to_node_policy•••Instead, use compare_tor_addr_to_node_policy everywhere. One advantage of this is that compare_tor_addr_to_node_policy can better distinguish 0.0.0.0 from "unknown", which caused a nasty bug with microdesc users. Nick Mathewson2011-07-15
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-17
|\|
| * Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-06-17
| |\
| | * Abandon rendezvous circuits on SIGNAL NEWNYMRobert Ransom2011-06-17
* | | Make the get_options() return const•••This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output! Nick Mathewson2011-06-14
* | | Merge remote-tracking branch 'origin/maint-0.2.2'•••The conflicts were mainly caused by the routerinfo->node transition. Conflicts: src/or/circuitbuild.c src/or/command.c src/or/connection_edge.c src/or/directory.c src/or/dirserv.c src/or/relay.c src/or/rendservice.c src/or/routerlist.c Nick Mathewson2011-05-30
|\| |
| * | Merge branch 'bug3045' into maint-0.2.2•••Conflicts: src/or/circuitbuild.c Nick Mathewson2011-05-30
| |\ \
| | * | Log descriptions of nodes, not just nicknames.•••This patch introduces a few new functions in router.c to produce a more helpful description of a node than its nickame, and then tweaks nearly all log messages taking a nickname as an argument to call these functions instead. There are a few cases where I left the old log messages alone: in these cases, the nickname was that of an authority (whose nicknames are useful and unique), or the message already included an identity and/or an address. I might have missed a couple more too. This is a fix for bug 3045. Nick Mathewson2011-05-15
* | | | Merge remote-tracking branch 'origin/maint-0.2.2'•••Conflicts: src/or/circuituse.c Nick Mathewson2011-05-30
|\| | |
| * | | Use the normal four-hop CBT for client intro circuits•••Fixes another part of bug 1297. Robert Ransom2011-05-30
| |/ /
* | | Merge remote-tracking branch 'origin/maint-0.2.2'•••Conflicts: src/or/connection_edge.c Nick Mathewson2011-05-15
|\| |
| * | Replace a nasty add-malloc-snprintf with a nice clean asprintfNick Mathewson2011-05-15
| * | Better doc for consider_recording_trackexithostNick Mathewson2011-05-15
| * | Raise the TrackHostExits membership code into its own functionNick Mathewson2011-05-13
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-12
|\| |
| * | Downgrade the "we launched 10 circuits for this stream" message. (See bug 3080)Nick Mathewson2011-05-12
* | | Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023•••Conflicts in various places, mainly node-related. Resolved them in favor of HEAD, with copying of tor_mem* operations from bug3122_memcmp_022. src/common/Makefile.am src/or/circuitlist.c src/or/connection_edge.c src/or/directory.c src/or/microdesc.c src/or/networkstatus.c src/or/router.c src/or/routerlist.c src/test/test_util.c Nick Mathewson2011-05-11
|\| |
| * | Merge remote-tracking branch 'public/3122_memcmp_squashed' into bug3122_memcm...•••Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c Nick Mathewson2011-05-11
| |\|
| | * Hand-conversion and audit phase of memcmp transition•••Here I looked at the results of the automated conversion and cleaned them up as follows: If there was a tor_memcmp or tor_memeq that was in fact "safe"[*] I changed it to a fast_memcmp or fast_memeq. Otherwise if there was a tor_memcmp that could turn into a tor_memneq or tor_memeq, I converted it. This wants close attention. [*] I'm erring on the side of caution here, and leaving some things as tor_memcmp that could in my opinion use the data-dependent fast_memcmp variant. Nick Mathewson2011-05-11
| | * Automated conversion of memcmp to tor_memcmp/tor_mem[n]eq•••This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h Nick Mathewson2011-05-11
* | | Merge remote-tracking branch 'origin/maint-0.2.2'•••Conflicts: src/or/rendcommon.h Nick Mathewson2011-04-28
|\| |
| * | Merge branch 'bug3k_021' into bug3k_022•••Conflicts: src/or/or.h src/or/rendclient.c Sebastian Hahn2011-04-28
| |\|
| | * Fix a failure case of connection_ap_handshake_attach_circuit()•••tor_fragile_assert() might be a no-op, so we have to return something here to indicate failure to the caller. Sebastian Hahn2011-04-28
| | * Allow rend_client_send_introduction to fail transiently•••i.e. without closing the AP connection. Robert Ransom2011-04-28
* | | Merge branch 'maint-0.2.2'•••Conflicts: src/or/dirserv.h Roger Dingledine2011-04-27
|\| |
| * | make make check-spaces happier.•••(still not happy.) Roger Dingledine2011-04-27
* | | Merge maint-0.2.2 for the bug1090-part1-squashed branch•••Resolved conflicts in: doc/tor.1.txt src/or/circuitbuild.c src/or/circuituse.c src/or/connection_edge.c src/or/connection_edge.h src/or/directory.c src/or/rendclient.c src/or/routerlist.c src/or/routerlist.h These were mostly releated to the routerinfo_t->node_t conversion. Nick Mathewson2011-04-27
|\| |
| * | warn if we launch too many circuits for a given streamRoger Dingledine2011-04-27
| * | revert most of ef81649d2fc•••Now we believe it to be the case that we never build a circuit for our stream that has an unsuitable exit, so we'll never need to use such a circuit. The risk is that we have some code that builds the circuit, but now we refuse to use it, meaning we just build a bazillion circuits and ignore them all. Roger Dingledine2011-04-27
| * | Add a circuit_purpose_to_string() function, and use it•••We had a circuit_purpose_to_controller_string() function, but it was pretty coarse-grained and didn't try to be human-readable. Nick Mathewson2011-04-27
| * | slight tweak on circuit_conforms_to_options•••this function really needs to get a total rewrite (or die) For now, use #if 0 to disable it. Roger Dingledine2011-04-26
* | | Merge remote-tracking branch 'origin/maint-0.2.2'•••Conflicts: src/common/address.c src/common/compat_libevent.c src/common/memarea.c src/common/util.h src/or/buffers.c src/or/circuitbuild.c src/or/circuituse.c src/or/connection.c src/or/directory.c src/or/networkstatus.c src/or/or.h src/or/routerlist.c Nick Mathewson2011-04-07
|\| |
| * | Merge remote-tracking branch 'public/xxx_fixups' into maint-0.2.2•••Conflicts: src/or/or.h Nick Mathewson2011-04-07
| |\ \
| | * | Triage the XXX022 and XXX021 comments remaining in the code•••Remove some, postpone others, leave some alone. Now the only remaining XXX022s are ones that seem important to fix or investigate. Nick Mathewson2011-03-25