summaryrefslogtreecommitdiff
path: root/src/or/circuitstats.c
AgeCommit message (Collapse)Author
2018-07-05Move literally everything out of src/orNick Mathewson
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.
2018-07-03Merge remote-tracking branch 'github/ticket26626'Nick Mathewson
2018-07-03Return U64_PRINTF_ARG and U64_FORMATNick Mathewson
The standard is printf("%"PRIu64, x);
2018-07-01Extract or_state_t to its own header.Nick Mathewson
Fewer modules needed this than I had expected.
2018-07-01Remove needless includes from or.hNick Mathewson
or.h should really include only the minimum of stuff from or/*, common/*, and lib/*.
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-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Extract crypt_path_t and relay_crypto_t into their own headersNick Mathewson
2018-06-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-06-02Merge branch 'maint-0.3.3'Nick Mathewson
2018-06-02Bug 26121: Improve BUILDTIMEOUT_SET accuracy.Mike Perry
We were miscounting the total number of circuits for the TIMEOUT_RATE and CLOSE_RATE fields of this event.
2018-05-07Merge branch 'maint-0.3.3'Nick Mathewson
2018-05-07Merge remote-tracking branch 'mikeperry/bug25733_029' into maint-0.3.3Nick Mathewson
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-04-27config: Make circuit_build_times_disabled() use authdir_mode()David Goulet
Don't access the AuthoritativeDir options directly. We do this so we can move authdir_mode() to the dirauth module. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-26Bug 25733: Avoid assert failure if all circuits time out.Mike Perry
Prior to #23100, we were not counting HS circuit build times in our calculation of the timeout. This could lead to a condition where our timeout was set too low, based on non HS circuit build times, and then we would abandon all HS circuits, storing no valid timeouts in the histogram. This commit avoids the assert.
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2017-12-08Merge remote-tracking branch 'mikeperry/bug23114_squashed2'Nick Mathewson
2017-12-07Report close and timeout rates since uptime, not based on data.Mike Perry
Bug #23114 was harder to see because we were just reporting our math, rather than reporting behavior.
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-07Bug #23100: Count all 3 hop circuits for CBT.Mike Perry
This change causes us to count anything once it reaches 3 hops (but not after).
2017-11-15Tweak the message when we re-enable CBT.Nick Mathewson
Implements ticket 20963.
2017-09-26Correct two state-file variable types.Nick Mathewson
These should have been int, but we had listed them as unsigned. That's an easy mistake to make, since "int" corresponds with either INT or UINT in the configuration file. This bug cannot have actually caused a problem in practice, since we check those fields' values on load, and ensure that they are in range 0..INT32_MAX.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-08-28Don't use "0" as a "base" argument to tor_parse_*().Nick Mathewson
Telling these functions to autodetect the numeric base has lead to trouble in the past. Fixes bug 22469. Bugfix on 0.2.2.various.
2017-05-18Merge branch 'maint-0.3.0'Nick Mathewson
2017-05-18Merge branch 'bug22252_029' into maint-0.3.0Nick Mathewson
2017-05-16Fix crash when starting with LearnCircuitBuildTimeout 0.Nick Mathewson
Before we've set our options, we can neither call get_options() nor networkstatus_get_latest_consensus(). Fixes bug 22252; bugfix on 4d9d2553baa6856b1d85ec26baa1ac3d2c24832a in 0.2.9.3-alpha.
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-18circuit: Make circuit_build_times_disabled take an or_options_tDavid Goulet
That way, when we are parsing the options and LearnCircuitBuildTimeout is set to 0, we don't assert trying to get the options list with get_options(). Fixes #21062 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-12Replace "people" with the appropriate network component in commentsJ. Ryan Stinnett
Fixes #18145.
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-09-13Refactor Single Onion code to improve consistencyteor
* Check consistency between the two single onion torrc options * Use the more relevant option each time we check for single onion mode * Clarify log messages * Clarify comments * Otherwise, no behaviour change
2016-09-13Use CircuitBuildTimeout whenever circuit_build_times_disabled is trueteor
Previously, we checked LearnCircuitBuildTimeout directly. Fixes bug #20073 in commit 5b0b51ca3 on tor 0.2.4.12-alpha.
2016-09-13Implement Prop #260: Single Onion Servicesteor (Tim Wilson-Brown)
Add experimental OnionServiceSingleHopMode and OnionServiceNonAnonymousMode options. When both are set to 1, every hidden service on a tor instance becomes a non-anonymous Single Onion Service. Single Onions make one-hop (direct) connections to their introduction and renzedvous points. One-hop circuits make Single Onion servers easily locatable, but clients remain location-anonymous. This is compatible with the existing hidden service implementation, and works on the current tor network without any changes to older relays or clients. Implements proposal #260, completes ticket #17178. Patch by teor & asn. squash! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Implement Prop #260: Single Onion Services Redesign single onion service poisoning. When in OnionServiceSingleHopMode, each hidden service key is poisoned (marked as non-anonymous) on creation by creating a poison file in the hidden service directory. Existing keys are considered non-anonymous if this file exists, and anonymous if it does not. Tor refuses to launch in OnionServiceSingleHopMode if any existing keys are anonymous. Similarly, it refuses to launch in anonymous client mode if any existing keys are non-anonymous. Rewrite the unit tests to match and be more comprehensive. Adds a bonus unit test for rend_service_load_all_keys().
2016-07-28Fix a huge pile of -Wshadow warnings.Nick Mathewson
These appeared on some of the Jenkins platforms. Apparently some GCCs care when you shadow globals, and some don't.
2016-02-27Update the copyright year.Nick Mathewson
2016-02-27Make sure that every module in src/or has a brief description.Nick Mathewson
2015-05-17Implement EVENT_NETWORK_LIVENESSAndrea Shepard
2015-02-06Add unit test for #13290Sebastian Hahn
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-02Apply new calloc coccinelle patchNick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-29Avoid division by zero in circuitstats paretoteor
In circuit_build_times_calculate_timeout() in circuitstats.c, avoid dividing by zero in the pareto calculations. If either the alpha or p parameters are 0, we would divide by zero, yielding an infinite result; which would be clamped to INT32_MAX anyway. So rather than dividing by zero, we just skip the offending calculation(s), and use INT32_MAX for the result. Division by zero traps under clang -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error.
2014-09-16Add script to detect and remove unCish malloc-then-cast patternNick Mathewson
Also, apply it.
2014-08-21Explicitly cast when dividing ints then implicitly casting to double.Nick Mathewson
Coverity thinks that when we do "double x = int1/int2;", we probably meant "double x = ((double)int1) / int2;". In these cases, we didn't. [Coverity CID 1232089 and 1232090]