aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.c
AgeCommit message (Collapse)Author
2015-01-07Merge remote-tracking branch 'public/bug12985_025'Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-27Merge remote-tracking branch 'andrea/cmux_refactor_configurable_threshold'Nick Mathewson
Conflicts: src/or/or.h src/test/Makefile.nmake
2014-11-12Replace operators used as macro arguments with OP_XX macrosNick Mathewson
Part of fix for 13172
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-30Make tor_libevent_get_base() mockableAndrea Shepard
2014-09-26Avoid a "constant variable guards dead code" warning from coverityNick Mathewson
Fixes CID 752028
2014-08-29Merge remote-tracking branch 'public/bug12985_024' into bug12984_025Nick Mathewson
2014-08-29Always event_del() connection events before freeing themNick Mathewson
Previously, we had done this only in the connection_free() case, but when we called connection_free_() directly from connections_free_all(), we didn't free the connections.
2014-04-16Get Libevent's PRNG functioning under the linux sandboxNick Mathewson
Libevent uses an arc4random implementation (I know, I know) to generate DNS transaction IDs and capitalization. But it liked to initialize it either with opening /dev/urandom (which won't work under the sandbox if it doesn't use the right pointer), or with sysctl({CTL_KERN,KERN_RANDOM,RANDOM_UUIC}). To make _that_ work, we were permitting sysctl unconditionally. That's not such a great idea. Instead, we try to initialize the libevent PRNG _before_ installing the sandbox, and make sysctl always fail with EPERM under the sandbox.
2014-03-05Fix whitespace errors, all of them mine.Nick Mathewson
2014-03-04Merge remote-tracking branch 'public/bug10169_024' into bug10169_025_v2Nick Mathewson
Conflicts: src/common/compat_libevent.h src/or/relay.c
2014-03-04Merge remote-tracking branch 'public/bug10169_023' into bug10169_024Nick Mathewson
Conflicts: src/or/relay.c
2014-02-26Monotonize the OOM-killer data timersNick Mathewson
In a couple of places, to implement the OOM-circuit-killer defense against sniper attacks, we have counters to remember the age of cells or data chunks. These timers were based on wall clock time, which can move backwards, thus giving roll-over results for our age calculation. This commit creates a low-budget monotonic time, based on ratcheting gettimeofday(), so that even in the event of a time rollback, we don't do anything _really_ stupid. A future version of Tor should update this function to do something even less stupid here, like employ clock_gettime() or its kin.
2014-02-12Add tests for buffer time tracking.Nick Mathewson
2013-09-01Added --library-versions flag to print the compile time and runtime versions ↵Kevin Butler
of libevent, openssl and zlib. Partially implements #6384.
2013-02-01Rename log() to tor_log() for loggingNick Mathewson
This is meant to avoid conflict with the built-in log() function in math.h. It resolves ticket 7599. First reported by dhill. This was generated with the following perl script: #!/usr/bin/perl -w -i -p s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g; s/\blog\(/tor_log\(/g;
2013-01-21More of b30d06255c24165 for #6826: fix compat_libevent compilationNick Mathewson
It looks like there was a compilation error for 6826 on some platforms. Removing even more now-uncallable code to handle detecting libevent versions before 1.3e. Fixes bug 8012; bug not in any released Tor.
2013-01-17Even more code-removal for 6826Nick Mathewson
(Pull on a thread and the whole sweater unravels.)
2013-01-17Drop detection logic for pre-1.3 busted libeventsNick Mathewson
This won't actually break them any worse than they were broken before: it just removes a set of warnings that nobody was actually seeing, I hope. Closes 6826
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-09-06Don't log about Libevent/OpenSSL initialization when all's wellNick Mathewson
OTOH, log the Libevent and OpenSSL versions on the first line when we're starting Tor.
2012-06-15Whitespace fixNick Mathewson
2012-06-15Move tor_gettimeofday_cached() into compat_libeventNick Mathewson
2012-06-04Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson
2012-06-04Add about 60 more DOCDOC comments to 0.2.3Nick Mathewson
Also, try to resolve some doxygen issues. First, define a magic "This is doxygen!" macro so that we take the correct branch in various #if/#else/#endifs in order to get the right documentation. Second, add in a few grouping @{ and @} entries in order to get some variables and fields to get grouped together.
2012-01-31Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32Nick Mathewson
This commit is completely mechanical; I used this perl script to make it: #!/usr/bin/perl -w -i.bak -p if (/^\s*\#/) { s/MS_WINDOWS/_WIN32/g; s/\bWIN32\b/_WIN32/g; }
2011-12-08appease check-spacesSebastian Hahn
This re-applies f77f9bddb8bf0dd6e9c3e0d94269aa23f459a272 which got accidentally reverted in 53f535aeb863204470379b2da4631770fa10b13f. Thanks asn for spotting this.
2011-12-06Revert "Use callback-driven approach to block renegotiations."Nick Mathewson
This reverts commit 406ae1ba5ad529a4d0e710229dab6ed645d42b50.
2011-12-06Revert "appease check-spaces"Nick Mathewson
This reverts commit f77f9bddb8bf0dd6e9c3e0d94269aa23f459a272.
2011-12-06Revert "Refactor tor_event_base_once to do what we actually want"Nick Mathewson
This reverts commit 7920ea55b8d994268d2b07f27316b0f34d8f27e5.
2011-12-06Revert "use event_free() wrapper; fix bug 4582"Nick Mathewson
This reverts commit 9a88c0cd32df53116a6bbb6b961650943755061c.
2011-12-06Revert "Make pending libevent actions cancelable"Nick Mathewson
This reverts commit aba25a6939a5907d40dbcff7433a8c130ffd12ad.
2011-11-29Make pending libevent actions cancelableNick Mathewson
This avoids a dangling pointer issue in the 3412 code, and should fix bug 4599.
2011-11-25use event_free() wrapper; fix bug 4582Nick Mathewson
2011-11-25Refactor tor_event_base_once to do what we actually wantNick Mathewson
This version avoids the timeout system entirely, gives a nicer interface, and lets us manage allocation explicitly.
2011-11-25Merge remote-tracking branch 'asn/bug4312'Nick Mathewson
2011-11-24appease check-spacesSebastian Hahn
2011-11-14Disable IOCP and retry event_base_new_with_config once on failureNick Mathewson
This is a fancier bug4457 workaround for 0.2.3. In 0.2.2, we could just tell Libevent "Don't enable locking!" so it wouldn't try to make the event_base notifiable. But for IOCP, we need a notifiable base. (Eventually, we'll want a notifiable base for other stuff, like multithreaded crypto.) So the solution is to try a full-featured initialization, and then retry with all the options turned off if that fails.
2011-11-14Merge remote-tracking branch 'public/bug4457_022' into bug4457_masterNick Mathewson
Conflicts: src/common/compat_libevent.c Resolving conflict by not taking 7363eae13cb8 ("Use the EVENT_BASE_FLAG_NOLOCK flag to prevent socketpair() invocation"): in Tor 0.2.3.x, we _do_ sometimes use notifiable event bases.
2011-11-14Detect failure from event_init() or event_base_new_with_config()Nick Mathewson
2011-11-14Use the EVENT_BASE_FLAG_NOLOCK flag to prevent socketpair() invocationNick Mathewson
In Tor 0.2.2, we never need the event base to be notifiable, since we don't call it from other threads. This is a workaround for bug 4457, which is not actually a Tor bug IMO.
2011-11-13Use callback-driven approach to block renegotiations.George Kadianakis
Also use this new approach in the bufferevents-enabled case.
2011-09-22Make bufferevents work with TokenBucketRefillIntervalNick Mathewson
2011-08-24Apply rate-limiting to the lowest bufferevent in the stack.Nick Mathewson
When we're doing filtering ssl bufferevents, we want the rate-limits to apply to the lowest level of the bufferevent stack, so that we're actually limiting bytes sent on the network. Otherwise, we'll read from the network aggressively, and only limit stuff as we process it.
2011-08-18Automatically use filtering bufferevents with IOCP.Nick Mathewson
2011-08-17Call evthread_use_windows_threads when running with IOCP on windowsNick Mathewson
2011-07-01Replace 4 more sscanf()s with tor_sscanf()Nick Mathewson
For some inexplicable reason, Coverity departs from its usual standards of avoiding false positives here, and warns about all sscanf usage, even when the formatting strings are totally safe. Addresses CID # 447, 446.
2011-05-23Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/common/Makefile.am src/or/control.c
2011-05-12Fix comment typoRobert Ransom