aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
AgeCommit message (Collapse)Author
2018-06-28Extract time functionality into lib/wallclock and lib/timeNick Mathewson
2018-06-28Move floating-point math functions into a new lib/mathNick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Move extend_info_t into its own header.Nick Mathewson
2018-06-15Split socks_request_t into its own header.Nick Mathewson
2018-06-15Extract cpath_build_state into its own header.Nick Mathewson
More modules use this than I had expected!
2018-06-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-06-15Split dir_connection_t into its own headerNick Mathewson
2018-06-15Split entry and edge_connection_t into their own headers.Nick Mathewson
2018-05-14Merge branch 'bug25903_v5_squashed'Nick Mathewson
2018-05-09Bug 25903: Perform accounting for new CIRC_BW fields.Mike Perry
Two new values in each direction. DELIVERED counts valid end-to-end circuit data that is accepted by our end and OVERHEAD counts the slack unused data in each of the relay command cells for those accepted cells. Control port changes are in the next commit.
2018-05-07Merge remote-tracking branch 'mikeperry/bug25705_v3_033'Nick Mathewson
2018-05-01Bug 25705: Don't count circuit path failures as build failures.Mike Perry
Also emit a rate limited log message when they happen, since they are likely correlated with other issues.
2018-04-22Merge branch 'bug25691_033_again_squashed'Nick Mathewson
2018-04-22Check for "the right descriptor", not just "any descriptor".Nick Mathewson
This patch adds a new node_has_preferred_descriptor() function, and replaces most users of node_has_descriptor() with it. That's an important change, since as of d1874b433953f64 (our fix for #25213), we are willing to say that a node has _some_ descriptor, but not the _right_ descriptor for a particular use case. Part of a fix for 25691 and 25692.
2018-04-11Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-11Bug 24989: Count client hsdir gets towards MaxClientCircuitsPending.Mike Perry
We removed this by breaking them out from general in #13837.
2018-02-20Remove a bunch of other redundant #includesNick Mathewson
Folks have found two in the past week or so; we may as well fix the others. Found with: \#!/usr/bin/python3 import re def findMulti(fname): includes = set() with open(fname) as f: for line in f: m = re.match(r'^\s*#\s*include\s+["<](\S+)[>"]', line) if m: inc = m.group(1) if inc in includes: print("{}: {}".format(fname, inc)) includes.add(m.group(1)) import sys for fname in sys.argv[1:]: findMulti(fname)
2018-02-15Merge remote-tracking branch 'ffmancera-1/bug18918'Nick Mathewson
2018-02-15Merge remote-tracking branch 'valentecaio/t-24714'Nick Mathewson
2018-02-14Merge remote-tracking branch 'mikeperry/bug24769'Nick Mathewson
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-06Merge remote-tracking branch 'dgoulet/bug25116_029_01'Nick Mathewson
2018-02-05Make circuit_log_ancient_one_hop_circuits() ignore established service ↵David Goulet
rendezvous Services can keep rendezvous circuits for a while so don't log them if tor is a single onion service. Fixes #25116 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-01refactor: rename connection_t struct fields.Caio Valente
connection_t.timestamp_lastwritten renamed to connection_t.timestamp_last_write_allowed connection_t.timestamp_lastread renamed to connection_t.timestamp_last_read_allowed Closes ticket 24714.
2018-01-31Bug 24769: Reduce and parameterize the max number of cbt circs.Mike Perry
Setting the default for this at 10 and the learning timeout to 3 minutes means we will complete our cbt learning in 30 minutes, which is under the reduced padding connection timeout window.
2018-01-26Remove a needless (always-true) check.Nick Mathewson
Also add an assertion and rename a variable. Closes ticekt 24927.
2018-01-24Clarify directory and ORPort checking functions.Fernando Fernandez Mancera
In order to make the OR and dir checking functions in router.c less confusing we renamed some functions and splitted consider_testing_reachability() into router_should_check_reachability() and router_do_reachability_checks(). Also we improved the documentation. Fixes #18918. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-23Merge remote-tracking branch 'mikeperry/bug24946'Nick Mathewson
2018-01-23Add onion service activity information to our heartbeat logs.George Kadianakis
2018-01-20Bug 24946: Fix a warning message caused by a missed purpose check.Mike Perry
Also fix three other checks (found by inspection of all CIRCUIT_PURPOSE_C_GENERAL occurrences).
2018-01-19Bug 23101: Pre-build HS-specific circuits (instead of general).Mike Perry
Prebuilt circs are 4 hops, since only server side HSDIR and intro circs are 3 hops, and it is OK if those sometimes take longer to build.
2018-01-19Add new circuit purposes for hsdir activity.Mike Perry
This lets us control their path len and usage.
2018-01-19Implement layer 2 and layer 3 guard pinning via torrc.Mike Perry
Block circuit canibalization when HSRendezvousMiddleNodes is active. Also make it apply to all HS circuits, not just rends.
2017-12-12Merge branch 'maint-0.3.2'Nick Mathewson
2017-12-12Merge branch 'bug24367_032_squashed' into maint-0.3.2Nick Mathewson
2017-12-12Simplify some conditionals in circuit_get_open_circ_or_launch()teor
When entry_list_is_constrained() is true, guards_retry_optimistic() always returns true. When entry_list_is_constrained() is false, options->UseBridges is always false, therefore !options->UseBridges is always true, therefore (!options->UseBridges || ...) is always true. Cleanup after #24367.
2017-12-08Merge remote-tracking branch 'mikeperry/bug23114_squashed2'Nick Mathewson
2017-12-07Merge branch 'arthuredelstein_18859+1_031' into maint-0.3.2Nick Mathewson
2017-12-07Add tests for circuitstats.cMike Perry
These tests primarily test the relaxed and measured behavior of circuitstats.c, to make sure we did not break it with #23100 or #23114.
2017-12-07Bug #23114: Time out circuits immediately.Mike Perry
This changes the purpose of circuits that are past the timeout to measurement *as they are built*, ensuring accurate application of the timeout logic.
2017-12-06Don't consider a port "handled" by an isolated circuit.Arthur Edelstein
Previously, circuit_stream_is_being_handled incorrectly reported that (1) an exit port was "handled" by a circuit regardless of whether the circuit was already isolated in some way, and (2) that a stream could be "handled" by a circuit even if their isolation settings were incompatible. As a result of (1), in Tor Browser, circuit_get_unhandled_ports was reporting that all ports were handled even though all non-internal circuits had already been isolated by a SOCKS username+password. Therefore, circuit_predict_and_launch_new was declining to launch new exit circuits. Then, when the user visited a new site in Tor Browser, a stream with new SOCKS credentials would be initiated, and the stream would have to wait while a new circuit with those credentials could be built. That wait was making the time-to-first-byte longer than it needed to be. Now, clean, not-yet-isolated circuit(s) will be automatically launched ahead of time and be ready for use whenever a new stream with new SOCKS credentials (or other isolation criteria) is initiated. Fixes bug 18859. Thanks to Nick Mathewson for improvements.
2017-11-22Stop checking cached bridge descriptors for usable bridgesteor
Stop checking for bridge descriptors when we actually want to know if any bridges are usable. This avoids potential bootstrapping issues. Fixes bug 24367; bugfix on 0.2.0.3-alpha. Stop stalling when bridges are changed at runtime. Stop stalling when old bridge descriptors are cached, but they are not in use. Fixes bug 24367; bugfix on 23347 in 0.3.2.1-alpha.
2017-11-20Merge branch 'bug23681_029_01_squashed' into maint-0.3.2Nick Mathewson
2017-11-20circuit: Don't timeout opened C_INTRODUCING circuitDavid Goulet
A circuit with purpose C_INTRODUCING means that its state is opened but the INTRODUCE1 cell hasn't been sent yet. We shouldn't consider that circuit when looking for timing out "building circuit". We have to wait on the rendezvous circuit to be opened before sending that cell so the intro circuit needs to be kept alive for at least that period of time. This patch makes that the purpose C_INTRODUCING is ignored in the circuit_expire_building() which means that we let the circuit idle timeout take care of it if we end up never using it. Fixes #23681 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-25circuit: Log n_circ_id and global identifier of HS circuitsDavid Goulet
So we can track them more easily in the logs and match any open/close/free with those identifiers. Part of #23645 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-25circuit: Log circuit identifiers when cannibalizingDavid Goulet
This removes the "nickname" of the cannibalized circuit last hop as it is useless. It now logs the n_circ_id and global identifier so we can match it with other logging statement. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-22Merge branch 'bug22805_v2_squashed'Nick Mathewson
2017-09-22Remove or_circuit_t.is_first_hop; use channel_is_client() insteadNick Mathewson
The is_first_hop field should have been called used_create_fast, but everywhere that we wanted to check it, we should have been checking channel_is_client() instead.