2730 Commits

Author SHA1 Message Date
Nick Mathewson
2b6fe8bb7f Make load-dependent monotonic timer tests off-by-default
You can reenable them with @all, or say @fine_timing just to get
them.
2012-06-29 12:47:51 -04:00
Nick Mathewson
5671033752 Avoid (unlikely) overflow in bench_httpclient.c 2012-06-29 12:47:39 -04:00
Nick Mathewson
c8009d2985 Check return value of write() in regress.c 2012-06-29 12:47:03 -04:00
Nick Mathewson
59f21fd8fc Merge branch '21_nonrecursive' 2012-06-28 16:52:21 -04:00
Nick Mathewson
f2cea873bb Make all tests that hit the network disabled by default
To run only these tests, run test/regress with @live_net.  To run all
tests, run test/regress with @all.
2012-06-28 13:18:28 -04:00
Nick Mathewson
ef7c4f7956 Update to latest tinytest (911b4f0349377) 2012-06-28 12:58:46 -04:00
Nick Mathewson
def3b83419 Make test_evutil_monotonic a little more tolerant 2012-06-28 12:57:58 -04:00
Nick Mathewson
9cd5acb511 Make th_base_lock nonrecursive
This is necessary for making some thread libraries work with
event.c, and might get better performance with others.

The biggest change required here was that we needed to make some
internal code that had previously called event_add and event_del
call the nolock variants.
2012-06-28 12:01:38 -04:00
Nick Mathewson
108896abcc Merge branch 'master' of ssh://github.com/libevent/libevent 2012-06-28 11:42:25 -04:00
Nick Mathewson
e2d7d98d9d remove a now-unused var in thread_deferred_cb_skew test 2012-06-28 11:37:45 -04:00
Nick Mathewson
8a739b3492 Merge branch '21_event_callback_v3' 2012-06-28 11:36:52 -04:00
Nick Mathewson
ea92fba36c Avoid a resource leak on error in http client benchmark 2012-06-25 13:55:45 -04:00
Nick Mathewson
0de587f47e 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.
2012-06-25 12:19:26 -04:00
Dave Hart
1aaf9f013b 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)
2012-06-18 10:31:38 -04:00
Nick Mathewson
e7bf4c84af Make the Makefile.nmake warning slightly less dire 2012-06-08 16:50:25 -04:00
Nick Mathewson
0ba0683bcf Add evutil_time.obj to Makefile.nmake 2012-06-08 16:45:01 -04:00
Nick Mathewson
90daab6184 Merge remote-tracking branch 'origin/patches-2.0' 2012-06-06 17:06:57 -04:00
Nick Mathewson
60f6540341 Merge pull request #57 from rosslagerwall/memleak
Fix a couple of memory leaks (found with Valgrind).
2012-06-06 14:10:11 -07:00
Ross Lagerwall
3b2529acf2 Fix a couple of memory leaks (found with Valgrind). 2012-06-06 21:57:12 +02:00
Nick Mathewson
0bbd850cc0 Merge pull request #56 from rosslagerwall/fix-comment
Fix a comment in test-fdleak after 077c7e949.
2012-06-04 14:16:02 -07:00
Ross Lagerwall
3881d8fdf6 Fix a comment in test-fdleak after 077c7e949. 2012-06-03 15:19:53 +02:00
Nick Mathewson
f3bd36728f Merge remote-tracking branch 'origin/patches-2.0' 2012-06-01 09:50:07 -04:00
Sebastian Hahn
fcec3e80c4 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
2012-06-01 05:23:29 +02:00
Nick Mathewson
f1284e73bd Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	evutil_rand.c

Had conflicts with _EVENT_ -> EVENT__ change.
2012-05-31 02:52:37 -04:00
Greg Hazel
bff5f94073 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.)
2012-05-31 00:48:24 -04:00
Nick Mathewson
76b994ac61 Merge pull request #54 from rosslagerwall/configure-dup
Remove unnecessary code in configure.in.
2012-05-21 10:59:20 -07:00
Nick Mathewson
9444524f85 Make it more clear that NOLOCK means "I promise, no multithreading" 2012-05-14 11:10:51 -04:00
Nick Mathewson
6fab9eef8f Add caveat to docs about bufferevent_free() with data in outbuf
Based on libevent-users thread wtih Alexander Klauer
2012-05-14 10:58:01 -04:00
Nick Mathewson
371efebdc3 Be more clear that LEV_OPT_DEFERRED_ACCEPT has tricky prereqs 2012-05-14 10:55:27 -04:00
Ross Lagerwall
e65914fdfe Remove unnecessary code in configure.in. 2012-05-12 08:38:19 +02:00
Nick Mathewson
7d6aa5ee68 Add an event_base_loopcontinue() to tell libevent to rescan right away 2012-05-09 12:06:00 -04:00
Nick Mathewson
c0e425abdc 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.
2012-05-09 12:06:00 -04:00
Nick Mathewson
581b5beb98 Give event_base_process_active a single exit path 2012-05-09 12:06:00 -04:00
Nick Mathewson
c46cb9c3a2 Make event_base_getnpriorities work with old "implicit base" code 2012-05-09 12:06:00 -04:00
Nick Mathewson
bd395549a3 Add a bufferevent_get_priority() function 2012-05-09 12:06:00 -04:00
Nick Mathewson
f90e25593c New event_get_priority() function to return an event's priority 2012-05-09 12:06:00 -04:00
Nick Mathewson
a4079aa88a Replace more deferred_cb names with event_callback 2012-05-09 12:05:59 -04:00
Nick Mathewson
ae2b84b257 Replace deferred_cbs with event_callback-based implementation. 2012-05-09 12:05:53 -04:00
Nick Mathewson
fec8bae267 event_base_assert_ok: check value of event_active_count for correctness 2012-05-09 12:05:53 -04:00
Nick Mathewson
745a63dba3 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.
2012-05-09 12:05:53 -04:00
Nick Mathewson
9889a3d883 Remove the unused bits from EVLIST_ALL 2012-05-09 12:05:53 -04:00
Nick Mathewson
cba59e5325 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.
2012-05-09 12:05:53 -04:00
Nick Mathewson
981aa0efc9 Merge remote-tracking branch 'origin/patches-2.0' 2012-05-03 16:37:39 -04:00
Nick Mathewson
faa92253e9 Bump version to 2.0.19-stable-dev 2012-05-03 16:34:29 -04:00
Nick Mathewson
8a9b0cdf63 Increment version to 2.0.19-stable release-2.0.19-stable 2012-05-03 12:33:36 -04:00
Nick Mathewson
e0aa08666e Merge remote-tracking branch 'github/patches-2.0'
Conflicts:
	test/regress.c
2012-05-03 12:21:57 -04:00
Nick Mathewson
e06206ebd8 Oops; fix the *right* windows compile issue 2012-05-03 12:15:11 -04:00
Nick Mathewson
be7a0be816 Fix win32 build issues: sleep, pid_t 2012-05-03 12:05:52 -04:00
Nick Mathewson
4b70286ef1 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	ChangeLog
	README
	evdns.c
	sample/dns-example.c
2012-05-02 17:12:23 -04:00
Nick Mathewson
cecb111bcd Start changelog for 2.0.19-stable 2012-05-02 17:09:11 -04:00