Log

Author Commit Date CI Message
Nick Mathewson 8a739b34 2012-06-28T11:36:52 Merge branch '21_event_callback_v3'
Nick Mathewson 0de587f4 2012-06-25T12:19:26 Simplify and correct evutil_open_closeonexec_ The original code needlessly called open in its two- or three- argument format depending on the O_CREAT flag; this should not be needed. The code also leaked an fd if fcntl() failed. Reported by Dave Hart.
Dave Hart 1aaf9f01 2012-06-18T10:31:38 Avoid giving a spurious warning when timerfd support is unavailable We forgot to do the obligatory "Check if there is no syscall there" dance when calling timerfd_create(). (Commit message by Nick)
Nick Mathewson e7bf4c84 2012-06-08T16:50:25 Make the Makefile.nmake warning slightly less dire
Nick Mathewson 0ba0683b 2012-06-08T16:45:01 Add evutil_time.obj to Makefile.nmake
Nick Mathewson 60f65403 2012-06-06T14:10:11 Merge pull request #57 from rosslagerwall/memleak Fix a couple of memory leaks (found with Valgrind).
Nick Mathewson 90daab61 2012-06-06T17:06:57 Merge remote-tracking branch 'origin/patches-2.0'
Ross Lagerwall 3b2529ac 2012-06-06T21:57:12 Fix a couple of memory leaks (found with Valgrind).
Nick Mathewson 0bbd850c 2012-06-04T14:16:02 Merge pull request #56 from rosslagerwall/fix-comment Fix a comment in test-fdleak after 077c7e949.
Ross Lagerwall 3881d8fd 2012-06-03T15:19:53 Fix a comment in test-fdleak after 077c7e949.
Nick Mathewson f3bd3672 2012-06-01T09:50:07 Merge remote-tracking branch 'origin/patches-2.0'
Sebastian Hahn fcec3e80 2012-06-01T05:23:29 Correctly check for arc4random_buf Apparently it's necssary to do an explicit comparison with NULL here. This also gets rid of a compile warning
Nick Mathewson f1284e73 2012-05-31T02:52:37 Merge remote-tracking branch 'origin/patches-2.0' Conflicts: evutil_rand.c Had conflicts with _EVENT_ -> EVENT__ change.
Greg Hazel bff5f940 2012-05-29T12:39:12 check for arc4random_buf at runtime, on OS X (Tweaked by nickm: Fix up the arcr4andom_buf OSX hack so that the fallback case isn't compiled into the code when we have arc4random_buf() and we are not on OSX. Also add a comment explaining what's up.)
Nick Mathewson 76b994ac 2012-05-21T10:59:20 Merge pull request #54 from rosslagerwall/configure-dup Remove unnecessary code in configure.in.
Nick Mathewson 9444524f 2012-05-14T11:10:51 Make it more clear that NOLOCK means "I promise, no multithreading"
Nick Mathewson 6fab9eef 2012-05-14T10:58:01 Add caveat to docs about bufferevent_free() with data in outbuf Based on libevent-users thread wtih Alexander Klauer
Nick Mathewson 371efebd 2012-05-14T10:55:27 Be more clear that LEV_OPT_DEFERRED_ACCEPT has tricky prereqs
Ross Lagerwall e65914fd 2012-05-12T08:38:19 Remove unnecessary code in configure.in.
Nick Mathewson 7d6aa5ee 2012-05-09T12:05:07 Add an event_base_loopcontinue() to tell libevent to rescan right away
Nick Mathewson c0e425ab 2012-05-09T11:06:06 Restore our priority-inversion-prevention code with deferreds Back when deferred_cb stuff had its own queue, the queue was always executed, but we never ran more than 16 callbacks per iteration. That made for two problems: 1: Because deferred_cb stuff would always run, and had no priority, it could cause priority inversion. 2: It doesn't respect the max_dispatch_interval code. Then, when I refactored deferred_cb to be a special case of event_callback, that solved the above issues, but made for two more issues: 3: Because deferred_cb stuff would always get the default priority, it could could low-priority bufferevents to get too much priority. 4: With code like bufferevent_pair, it's easy to get into a situation where two deferreds keep adding one another, preventing the event loop from ever actually scanning for more events. This commit fixes the above by giving deferreds a better notion of priorities, and by limiting the number of deferreds that can be added to the _current_ loop iteration's active queues. (Extra deferreds are put into the active_later state.) That isn't an all-purpose priority inversion solution, of course: for that, you may need to mess around with max_dispatch_interval.
Nick Mathewson 581b5beb 2012-05-09T10:50:07 Give event_base_process_active a single exit path
Nick Mathewson c46cb9c3 2012-05-09T10:49:28 Make event_base_getnpriorities work with old "implicit base" code
Nick Mathewson bd395549 2012-05-08T18:04:19 Add a bufferevent_get_priority() function
Nick Mathewson f90e2559 2012-05-08T17:46:46 New event_get_priority() function to return an event's priority
Nick Mathewson a4079aa8 2012-04-06T11:05:35 Replace more deferred_cb names with event_callback
Nick Mathewson ae2b84b2 2012-04-06T04:33:19 Replace deferred_cbs with event_callback-based implementation.
Nick Mathewson fec8bae2 2012-04-06T03:15:50 event_base_assert_ok: check value of event_active_count for correctness
Nick Mathewson 745a63db 2012-04-06T03:00:40 Add "active later" event_callbacks to supersede deferred An event or event callback can now be in an additional state: "active later". When an event is in this state, it will become active the next time we run through the event loop. This lets us do what we wanted to with deferred callbacks: make a type of active thing that avoids infinite circular regress in a way that starves other events or exhausts the stack. It improves on deferred callbacks by respecting priorities, and by having a non-kludgy way to avoid event starvation.
Nick Mathewson 9889a3d8 2012-04-05T12:56:07 Remove the unused bits from EVLIST_ALL
Nick Mathewson cba59e53 2012-04-05T12:38:18 Refactor the callback part of an event into its own event_callback type This shouldn't have any visible effect, but it's necessary or advisible for a few changes and cleanups I would like to make, including: * Replacing the deferred queue with a type that works more as if it were an event. * Introducing a useful "activate this on the next round through the event loop" state for events and deferreds. * Adding an "on until further notice" status for events, to allow a saner win32-hybrid approach. * Eventually, making all user callbacks first-class things with event-like semantics.
Nick Mathewson 981aa0ef 2012-05-03T16:37:39 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson faa92253 2012-05-03T16:34:29 Bump version to 2.0.19-stable-dev
Nick Mathewson 8a9b0cdf 2012-05-03T12:33:36 Increment version to 2.0.19-stable
Nick Mathewson e0aa0866 2012-05-03T12:21:57 Merge remote-tracking branch 'github/patches-2.0' Conflicts: test/regress.c
Nick Mathewson e06206eb 2012-05-03T12:15:11 Oops; fix the *right* windows compile issue
Nick Mathewson be7a0be8 2012-05-03T12:05:52 Fix win32 build issues: sleep, pid_t
Nick Mathewson 4b70286e 2012-05-02T17:12:23 Merge remote-tracking branch 'origin/patches-2.0' Conflicts: ChangeLog README evdns.c sample/dns-example.c
Nick Mathewson cecb111b 2012-05-02T17:09:11 Start changelog for 2.0.19-stable
Nick Mathewson 265e6779 2012-05-02T16:52:27 Fix evdns build with threads disabled The last evdns change apparently broke it, by using a "base" variable that we were only declaring with threads turned on.
Nick Mathewson 3d9e52ac 2012-05-01T19:52:55 When retransmitting a timed-out DNS request, pick a fresh nameserver. Otherwise, requests initially sent to a failing nameserver would stay there indefinitely, even if other nameservers would work. Fix for sourceforge bug 3518439
Nick Mathewson d873d678 2012-05-01T19:52:49 Make some evdns.c debug logs more verbose
Nick Mathewson 6610fa5a 2012-05-01T17:07:50 dns-example.c can now take a resolv.conf file on the commandline
Nick Mathewson 9fbfe9b9 2012-05-01T13:03:33 Correctly handle running on a system where accept4 doesn't work. Previously, we treated EINVAL as the only errno that indicated a broken accept4. But EINVAL only appears when one of the SOCK_* options isn't supported. If the accept4 syscall itself isn't there, we'll get an ENOSYS. Reported by Azat Khuzhin.
Nick Mathewson a1630260 2012-05-01T13:22:56 Merge branch '21_robust_monotonic'
Nick Mathewson 2e882a07 2012-04-30T22:00:05 Merge remote-tracking branch 'origin/patches-2.0' Conflicts: event.c
Nick Mathewson 30f06715 2012-04-30T21:45:43 Merge remote-tracking branch 'github/20_active_prio_inv' into patches-2.0
Nick Mathewson b98624ef 2012-04-30T21:33:56 Merge remote-tracking branch 'origin/patches-2.0' Conflicts: bufferevent_openssl.c
Nick Mathewson b3887cdf 2012-04-11T21:33:27 Work-around a stupid gcov-breaking bug in OSX 10.6 This only affects the unit tests. Fix found at http://rachelbythebay.com/w/2011/07/12/forkcrash/ (Backport from 2.1)
Mark Ellzey 4e62cd16 2012-03-30T15:08:40 Fixed potential double-readcb execution with openssl bufferevents. the function do_read() will call SSL_read(), and if successful, will call _bufferevent_run_readcb() before returning to consider_reading(). consider_reading() will then check SSL_pending() to make sure all pending data has also been read. If it does not, do_read() is called again. The issue with this is the possibility that the function that is executed by _bufferevent_run_readcb() called bufferevent_disable(ssl_bev, EV_READ) before the second do_read(); In this case, the users read callback is executed a second time. This is potentially bad for applications that expect the bufferevent to stay disabled until further notice. (this is why running openssl bufferevents without DEFER_CALLBACKS has always been troublesome).
Nick Mathewson 2bfda401 2012-04-30T17:30:48 If a higher-priority event becomes active, don't continue running events of the current priority. Bug found by Ralph Castain.
Zack Weinberg 5859c235 2012-04-27T09:32:51 Generate event-config.h with a single sed script This approach should make the creation of the file more atomic, to fix a bug reported by Dinh. This patch has one change from Zack's original version: it avoids $<, since Dave Hart tells me he thinks that's not so portable. (commit message by nickm)
Nick Mathewson e0222274 2012-04-27T09:36:13 Merge remote-tracking branch 'origin/patches-2.0'
Zack Weinberg 30b6f889 2012-04-27T09:32:51 Generate event-config.h with a single sed script This approach should make the creation of the file more atomic, to fix a bug reported by Dinh. This patch has one change from Zack's original version: it avoids $<, since Dave Hart tells me he thinks that's not so portable. (commit message by nickm)
Nick Mathewson 26c75828 2012-04-26T16:22:03 When PRECISE_TIMERS is set with epoll, use timerfd for microsecond precision The epoll interface ordinarily gives us one-millisecond precision, so on Linux it makes perfect sense to use the CLOCK_MONOTONIC_COARSE timer. But when the user has set the new PRECISE_TIMER flag for an event_base (either by the EVENT_BASE_FLAG_PRECISE_TIMER flag, or by the EVENT_PRECISE_TIMER environment variable), they presumably want finer granularity. On not-too-old Linuxes, we can achieve this using the Timerfd mechanism, which accepts nanosecond granularity and understands posix clocks. It's a little more expensive than just calling epoll_wait(), so we won't do it by default.
Nick Mathewson 7428c78a 2012-04-26T14:35:18 Improve the monotonic-time unit test: make it check the step size
Nick Mathewson 630f077c 2012-04-26T11:56:59 Simple unit tests for monotonic timers
Nick Mathewson 2c470452 2012-04-23T13:33:25 Implement fast/precise monotonic clocks on Windows This uses code from libutp, which was released under the MIT license; see evutil_time.c and LICENSE changes.
Nick Mathewson a2598ec6 2012-04-23T13:56:00 Add EVENT_PRECISE_TIMER environment var for selecting precise-but-slow timer
Nick Mathewson f5e4eb05 2012-04-20T13:14:10 Refactor monotonic timer handling into a new type and set of functions; add a gettimeofday-based ratcheting implementation Now, event.c can always assume that we have a monotonic timer; this makes event.c easier to write.
Nick Mathewson 71bca50f 2012-04-20T12:27:12 Split out time-related prototypes into time-internal.h
Nick Mathewson c4194854 2012-04-20T12:19:03 Split out time-related evutil functions into a new evutil_time.c
Nick Mathewson 2711cda3 2012-04-20T12:14:20 Split long lists in Makefile.am into one-item-per-line
Nick Mathewson 21205b83 2012-04-20T11:53:32 Shave 700 msec off the persistent_timeout_jump test
Nick Mathewson d992d911 2012-04-20T11:51:33 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 03614a16 2012-04-20T11:51:13 Merge branch '20_periodic_event_overload_v2' into patches-2.0
Nick Mathewson dfd808cb 2012-04-19T00:25:12 If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead Fixes an issue reported on libevent-users in the thread "a dead looping bug when changing system time backward". Previously, if time jumped forward 1 hour[*] and we had a one-second periodic timer event, that event would get invoked 3600 times. That's almost certainly not what anybody wants. In a future version of Libevent, we should expose the amount of time that the callbac kwould have been invoked somehow. [*] Forward time jumps can happen with nonmonotonic clocks, or with clocks that jump on suspend/resume. It can also happen from Libevent's point of view if the user exits from event_base_loop() and doesn't call it again for a while.
Nick Mathewson bec22b41 2012-04-19T18:15:12 Refactor event_persist_closure: raise and extract some common logic
Nick Mathewson 3f659e5a 2012-04-19T11:14:58 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 37c4fc8d 2012-04-19T08:11:05 Merge pull request #52 from ghazel/20_evdns_probe cancel the probe request when the server is freed, and ignore cancelled probe callbacks
Greg Hazel 46b80608 2012-04-18T21:41:48 remove redundant DNS_ERR_CANCEL check, move comment
Greg Hazel 94d23360 2012-04-18T21:29:21 cancel the probe request when the server is freed, and ignore cancelled probe callbacks
Nick Mathewson 26ee5f90 2012-04-18T12:24:19 Note that make_base_notifiable should not be necessary
Nick Mathewson 5595a79f 2012-04-17T17:54:26 Merge branch '21_choose_monotonic'
Nick Mathewson d5e1d5ad 2012-04-17T15:16:08 Implement a GetTickCount-based monotonic timer for Windows
Nick Mathewson 55780a70 2012-04-17T13:09:49 On Linux, use CLOCK_MONOTONIC_COARSE by default You can make it use CLOCK_MONOTONIC again by setting the EVENT_BASE_FLAG_PRECISE_TIMER flag in the event_config.
Nick Mathewson ddd69d39 2012-04-17T13:04:02 EVENT_BASE_FLAG_PRECISE_TIMER indicates we want fine timer precision There are a bunch of backends that can give us a reasonably good monotonic timer quickly, or a very precise monotonic timer less quickly. For example, Linux has CLOCK_MONOTONIC_COARSE (1msec precision), which is over twice as fast as CLOCK_MONOTONIC. Since epoll only lets you wait with 1msec precision, CLOCK_MONOTONIC_COARSE is a clear win. On Windows, you've got GetTickCount{,64}() which is fast, and QueryPerformanceCounter, which is precise but slow. Note that even in the cases where the underlying timer claims to have nanosecond resolution, we're still not exposing that via Libevent. Note also that "Precision" isn't the same as "Resolution" or "Accuracy". A timer's precision is the smallest change that the clock will register; a timer's resolution is the fineness of its underlying representation; a timer's accuracy is how much it drifts with respect to "Real Time", whatever that means. (Terms and definitions from PEP 418.)
Nick Mathewson 1fbef7d5 2012-04-17T12:44:39 Move use_monotonic and friends into event_base The use_monotonic field used to be a static field set up at library setup. Unfortunately, this makes it hard to give the user a way to make speed/accuracy tradeoffs about time. Moving it into event_base should let the clock implementation become configurable.
Nick Mathewson b62b31f1 2012-04-11T21:33:27 Work-around a stupid gcov-breaking bug in OSX 10.6 This only affects the unit tests. Fix found at http://rachelbythebay.com/w/2011/07/12/forkcrash/
Nick Mathewson 53a07fe2 2010-09-17T00:34:13 Replace pipe-based notification with EVFILT_USER where possible Sufficiently recent kqueue implementations have an EVFILT_USER filter that we can use to wake up an event base from another thread. When it's supported, we now use this mechanism rather than our old (pipe-based) mechanism. This should save some time and complications on newer OSX and freebsds.
Nick Mathewson 9bf866f5 2012-04-09T19:49:58 Merge remote-tracking branch 'github/21_mach_time'
Nick Mathewson cb653a00 2012-04-09T13:41:45 Do not track use_monotonic field when is no monotonic clock
Nick Mathewson b8fd6f91 2012-04-09T13:39:11 Use mach_absolute_time() for monotonic clock support on OSX.
Nick Mathewson a969f7e7 2012-04-09T08:40:45 Merge pull request #50 from rosslagerwall/simplify-test Simplify test.sh code significantly.
Nick Mathewson 0af23d59 2012-04-09T11:33:08 Merge branch '21_weakrand'
Nick Mathewson 3aa44159 2012-04-09T11:30:46 Tweak the new evutil_weakrand_() code Make its state actually get seeded. Document it more thoroughly. Turn its state into a structure. Fix a bug in evutil_weakrand_range_() where it could return the top of the range. Change its return type to ev_int32_t. Add a quick unit test to make sure that the value of evutil_weakrand_range_() is in range.
Nicholas Marriott e86af4b7 2012-04-09T10:46:32 Change evutil_weakrand_() to avoid platform random() This change allows us to avoid perturbing the platform's random(), and to avoid hitting locks on random() in the platform's libc. evutil_weakrand_() is, well, weak, so we choose here an algorithm that favors speed over a number of other possibly desirable properties. We're using a linear congruential generator, and taking our parameters from those shared by the OpenBSD random() implementation, and Glibc's fastest random() implementation. The low bits of a LCG of modulus 2^32 are (notoriously) less random than the higher bits. So to generate a random value in a range, using the % operator is no good; we ought to divide. We add an evutil_weakrand_range_() function to do that. This code also changes the interface of evutil_weakrand_() so that it now manipulates an explicit seed, rather than having the seed in a static variable. This change enables us to use existing locks to achieve thread-safety, rather than having to rely on an additional lock. (Patch by Nicholas Marriott; commit message by Nick Mathewson.)
Ross Lagerwall 9b856fd5 2012-04-07T17:32:00 Simplify test.sh code significantly. Also make it easier to add new tests/backends.
Nick Mathewson d9a55153 2012-04-03T20:30:54 Increment the version to 2.1.1-alpha-dev
Nick Mathewson 6f2337dd 2012-04-03T18:39:30 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson d1a03b2f 2012-04-03T18:31:08 Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* This is a partial backport of cb9da0bf and a backport of c9635349. Because C doesn't like us to declare identifiers starting with an underscore, Libevent 2.1 has renamed every such identifier. The only change that affects a public API is that the _EVENT_LOG_* macros have been renamed to start with EVENT_LOG instead. The old names are still present, but deprecated. I'm doing this backport because it represents the deprecation of a Libevent 2.0 interface, and folks should have the opportunity to write code that isn't deprecated and works with both 2.0 and 2.1.
Nick Mathewson 3ef4b353 2012-04-03T17:27:07 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 88b4f0bb 2012-04-03T17:26:25 fix some typos in the 2.1 changelog
Nick Mathewson 3faaad49 2012-04-03T17:26:12 Bump the version to Libevent 2.1.1-alpha
Nick Mathewson f775521c 2012-04-03T17:25:36 Fix the website URL in the readme
Nick Mathewson 2dedff36 2012-04-03T16:50:54 Try to finalize changelog situation for 2.1.1-alpha
Nick Mathewson ba696dce 2012-04-03T16:35:36 Merge remote-tracking branch 'vm/21_fix_nmake_build'
Nick Mathewson 2bb8f2dd 2012-04-03T16:35:26 Add pending names to the README; add more entries to the changelog
Nick Mathewson bcf52585 2012-04-03T16:24:18 Include ws2tcpip.h from util.h to get EAI_* definitions. This is necessary on msvc, to get the EVUTIL_EAI_* values defined properly
Nick Mathewson 2449e0c5 2012-04-03T16:15:49 Fix some compilation warnings with msvc