aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitstats.c
AgeCommit message (Collapse)Author
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]
2014-08-13Apply coccinelle script to replace malloc(a*b)->calloc(a,b)Nick Mathewson
2014-04-08Check for new IP addr after circuit liveliness returnsMatthew Finkel
When we successfully create a usable circuit after it previously timed out for a certain amount of time, we should make sure that our public IP address hasn't changed and update our descriptor.
2014-03-24quiet the debug message in circuit_build_times_disabled()Roger Dingledine
something recently made it get called once per second, which will clutter up your debug log file.
2013-08-25Cleanup whitespacesNick Mathewson
2013-08-22Hide the contents of the circuit_build_times structure.Nick Mathewson
There were only two functions outside of circuitstats that actually wanted to know what was inside this. Making the structure itself hidden should help isolation and prevent us from spaghettifying the thing more.
2013-08-22Documentation for new cbt accessorsNick Mathewson
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-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-03-27Clarify liveness log message and lower it to notice.Mike Perry
It could just be due to small clock jumps, after all.
2013-03-20Merge remote-tracking branch 'public/bug6304_v3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/circuitbuild.c src/or/config.c
2013-02-01Rename and relocate the bw weight scale param getter.Mike Perry
It had nothing to do with circuit build times.
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-12-07Bug 3443: Don't count ORconn setup in circuit build time.Mike Perry
Also, add a hack Roger suggested where we're more patient if no circuits are opened yet.
2012-10-15Move the circuit build timeout code into its own file.Nick Mathewson