summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2018-04-23Merge remote-tracking branch 'github/lazy_bucket_refill'Nick Mathewson
2018-04-23Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-23Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-04-23Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-04-23Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-04-23Permit the nanosleep system call in the seccomp2 callboxNick Mathewson
Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
2018-04-23Merge remote-tracking branch 'neel/b25511-r4'Nick Mathewson
2018-04-22Merge branch 'ticket25024_squashed'Nick Mathewson
2018-04-22add changes file and update check-typos in makefileDeepesh Pathak
2018-04-22Merge remote-tracking branch 'mikeperry/bug25400_squashed'Nick Mathewson
2018-04-17Amend token_bucket_rw_dec to indicate which buckets became empty.Nick Mathewson
2018-04-17token bucket: Add parens to rate_per_sec_to_rate_per_step()Nick Mathewson
Typecasts bind more tightly than division, so we need to do the division first.
2018-04-17Merge remote-tracking branch 'public/bug24688'Nick Mathewson
2018-04-16Make tor_gettimeofday() mockableNeel Chauhan
2018-04-16Add format_local_iso_time_nospace()Neel Chauhan
2018-04-16Helper function to add u32 without overflow.Mike Perry
2018-04-16token: Fix uint32_t to uint64_t conversionDavid Goulet
Unfortunately, the units passed to monotime_coarse_stamp_units_to_approx_msec() was always 0 due to a type conversion. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-16Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-16Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-04-16Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-04-16Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-04-16Fix an LCOV exclusion pattern in address.cNick Mathewson
2018-04-13token_bucket: Fix indentationDavid Goulet
Both header and code file had some indentation issues after mass renaming. No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-13Merge branch 'token_bucket_once_again_squashed'Nick Mathewson
2018-04-13Refactor "timestamp" not to be its own type coupled to token buffersNick Mathewson
Really, the uint32_t is only an optimization; any kind of unit should work fine. Some users might want to use time_t or monotime_coarse_t or something like that.
2018-04-13Move token_bucket_raw_* functions to the start of the module.Nick Mathewson
(These functions were previously helper functions for token_bucket_rw_t).
2018-04-13Never pick a rate of 0.Nick Mathewson
(The tests caught this one.)
2018-04-13Start re-refactoring the token bucket interface.Nick Mathewson
Begin by creating a lowest-level triple of the types needed to implement a token bucket: a configuration, a timestamp, and the raw bucket itself. Note that for low-level buckets, the units of the timestamp and the bucket itself are unspecified: each user can use a different type. (This patch breaks check-spaces; a later patch will fix it)
2018-04-13Merge branch 'postloop_callbacks_2'Nick Mathewson
2018-04-13Rename token_bucket_t to token_bucket_rw_t.Nick Mathewson
This is a simple search-and-replace to rename the token bucket type to indicate that it contains both a read and a write bucket, bundled with their configuration. It's preliminary to refactoring the bucket type.
2018-04-13Merge branch 'token_bucket_refactor_squashed'Nick Mathewson
2018-04-13Generic mechaism for "post-loop" callbacksNick Mathewson
We've been labeling some events as happening "outside the event loop", to avoid Libevent starvation. This patch provides a cleaner mechanism to avoid that starvation. For background, the problem here is that Libevent only scans for new events once it has run all its active callbacks. So if the callbacks keep activating new callbacks, they could potentially starve Libevent indefinitely and keep it from ever checking for timed, socket, or signal events. To solve this, we add the ability to label some events as "post-loop". The rule for a "post-loop" event is that any events _it_ activates can only be run after libevent has re-scanned for new events at least once.
2018-04-13Accept small hops backward in the monotonic timer.Nick Mathewson
2018-04-13Add a helper function to decrement read and write at the same timeNick Mathewson
2018-04-13Add a new token-bucket backend abstraction, with testsNick Mathewson
This differs from our previous token bucket abstraction in a few ways: 1) It is an abstraction, and not a collection of fields. 2) It is meant to be used with monotonic timestamps, which should produce better results than calling gettimeofday over and over.
2018-04-13Expose a function that computes stamp units from msec.Nick Mathewson
(It turns out we can't just expose STAMP_TICKS_PER_SECOND, since Apple doesn't have that.)
2018-04-12Remove windows log_from_handle as unused.Nick Mathewson
This function was only used by PortForwardingHelper, which was removed in 9df110cd72. Its presence caused warnings on windows.
2018-04-12Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-12Make get_total_system_memory mockable.Alexander Færøy
This patch makes get_total_system_memory mockable, which allows us to alter the return value of the function in tests. See: https://bugs.torproject.org/24782
2018-04-10Merge remote-tracking branch 'isis-github/bug25409'Nick Mathewson
2018-04-09Prefer 32-bit implementation for timing wheels on 32-bit systems.Nick Mathewson
This might make our timing-wheel code a tiny bit faster there. Closes ticket 24688.
2018-04-09compat: Fix unchecked return value from event_del()David Goulet
Explicitly tell the compiler we don't care about it. Coverity CID 1434156 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-05Move responsibility for threadpool reply-handler events to workqueueNick Mathewson
This change makes cpuworker and test_workqueue no longer need to include event2/event.h. Now workqueue.c needs to include it, but that is at least somewhat logical here.
2018-04-05Wrap the function we use to run the event loop.Nick Mathewson
Doing this lets us remove the event2/event.h header from a few more modules, particularly in the tests. Part of work on 23750.
2018-04-05Add wrappers for event_base_loopexit and event_base_loopbreak.Nick Mathewson
2018-04-05Revise procmon.c to use periodic_timer_tNick Mathewson
This removes its need to use event2/event.h, and thereby fixes another instance of 23750.
2018-04-05Add an API for a scheduled/manually activated event in the mainloopNick Mathewson
Using this API lets us remove event2/event.h usage from half a dozen modules, to better isolate libevent. Implements part of ticket 23750.
2018-04-04Remove PortForwarding optionsNeel Chauhan
Signed-off-by: Isis Lovecruft <isis@torproject.org>
2018-04-02Remove event2/event.h include from compat_libevent.hNick Mathewson
Only one module was depending on this include (test_helpers.c), and it was doing so incorrectly.
2018-03-28Merge remote-tracking branch 'hello71/bug25398'Nick Mathewson