|
3cde5bf5
|
2012-07-26T10:04:43
|
|
Avoid more crashes/bad calls in unit tests; found by coverity
|
|
4f3732d7
|
2012-07-26T09:35:43
|
|
Fix various check-after-dereference issues in unit tests: found by coverity
|
|
e06206eb
|
2012-05-03T12:15:11
|
|
Oops; fix the *right* windows compile issue
|
|
be7a0be8
|
2012-05-03T12:05:52
|
|
Fix win32 build issues: sleep, pid_t
|
|
30f06715
|
2012-04-30T21:45:43
|
|
Merge remote-tracking branch 'github/20_active_prio_inv' into patches-2.0
|
|
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)
|
|
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.
|
|
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.
|
|
e49e2891
|
2012-02-10T17:29:53
|
|
Update copyright notices to 2012
|
|
27737d55
|
2012-01-21T12:55:15
|
|
Add function to check referential integrity of an event_base
|
|
3c824bd3
|
2011-10-24T13:18:09
|
|
Update copyright dates to 2011.
|
|
2b768479
|
2011-10-03T12:45:36
|
|
Make write-checking fixes use tt_fail_perror
|
|
c3b62fd7
|
2011-07-12T13:05:36
|
|
Fixed compiler warnings for unchecked read/write calls.
|
|
c11c6fcd
|
2011-05-27T14:57:55
|
|
Disable main/many_events_slow_add with evport backend
In 2.0 and earlier, evport only reports up to 8 events at a time, which
confuses this test badly.
|
|
d11e9e0f
|
2011-05-03T14:22:48
|
|
Oops; that new unit test breaks for epoll. Fix it.
|
|
28317a08
|
2011-05-03T13:54:57
|
|
Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors
Apparently, kevent fails gracefully if there is not enough space in its
output events array to report every _event_... but it just dies and returns
-1 if there is not enough space to report every _error_.
There are a couple of possible fixes here. One would to handle -1
returns from kevent better by re-growing the array and retrying... but
that seems a little error prone. Instead, I'm just going to say that
the events array must be large enough to handle all the errors.
This patch also adds a unit test designed to make sure that our
many-events-out code works even if not all the events are added at
once.
|
|
22f4af65
|
2010-12-09T11:43:12
|
|
Remove end-of-line whitespace
|
|
7bcace2d
|
2010-11-22T21:02:34
|
|
Fix some irix compilation warnings spotted by Kevin Bowling
|
|
aed7e029
|
2010-11-22T14:10:01
|
|
Make unit tests for epoll-with-changelist pass
The only changes needed were to handle the fact that the methodname
"epoll (with changelist)" matches the environment variable
EVENT_NOEPOLL rather than the imaginary "EVENT_EPOLL (WITH CHANGELIST)".
|
|
34b84b97
|
2010-11-03T14:38:45
|
|
Fix more wn64 warnings.
|
|
5d389dc0
|
2010-10-26T22:27:57
|
|
Fix some uses of int for socket in regress
|
|
c281aba3
|
2010-10-24T11:38:29
|
|
Fix a nasty bug related to use of dup() with epoll on Linux
Current versions of the Linux kernel don't seem to remove the struct
epitem for a given (file,fd) combo when the fd is closed unless the
file itself is also completely closed. This means that if you do:
fd = dup(fd_orig);
add(fd);
close(fd);
dup2(fd_orig, fd);
add(fd);
you will get an EEXIST when you should have gotten a success. This
could cause warnings and dropped events when using dup and epoll.
The solution is pretty simple: when we get an EEXIST from
EPOLL_CTL_ADD, we retry with EPOLL_CTL_MOD.
Unit test included to demonstrate the bug.
Found due to the patient efforts of Gilad Benjamini; diagnosed with
help from Nicholas Marriott.
|
|
e5c214a4
|
2010-10-14T13:16:41
|
|
Fix -Wsigned-compare warnings in test/*
|
|
4858b794
|
2010-09-15T01:54:51
|
|
Remove the now-useless evsig_caught and evsig_process
|
|
720bd933
|
2010-09-15T01:08:39
|
|
Warn when using the error-prone EV_SIGNAL interface in an error-prone way. Also, fix a couple of race conditions in signal.c
When using the signal.c signal backend, Libevent currently only allows
one event_base to actually receive signals at a time. (This has been
the behavior since at least 1.4 and probably much earlier.) Now, we
detect and warn if you're likely to be racing about which signal goes
to which thread.
We also add a lock to control modifications of the evsig_base field,
to avoid race conditions like those found by Jason Toffaletti.
Also, more comments. Comments are good.
|
|
25b6a74b
|
2010-09-08T14:53:57
|
|
Merge branch 'tests'
|
|
ce85280b
|
2010-09-08T13:29:06
|
|
Improve testing of when thread-notification occurs
|
|
1115366e
|
2010-09-07T10:28:15
|
|
Fix a few memory leaks in the tests
|
|
ec347b92
|
2010-07-07T16:45:03
|
|
Move event-config.h to include/event2
This change means that all required include files are in event2, and
all files not in event2/* are optional.
|
|
42a8c711
|
2010-07-31T17:10:04
|
|
Build more cleanly with NetBSDs that dislike toupper(char)
To be fair, when char can be signed, if toupper doesn't take negative
characters, toupper(char) is a very bad idea. So let's just use the
nice safe EVUTIL_TOUPPER instead. (It explicitly only upcases ASCII,
but we only use it for identifiers that we know to be ASCII anyway).
|
|
7510aac3
|
2010-06-21T12:23:32
|
|
Unit test for event_get_struct_event_size()
|
|
44d57eee
|
2010-06-03T11:25:54
|
|
Add test for behavior on remote socket close
On all the backends on this little mac laptop, that behavior is to
report a remote socket close as both EV_READ and EV_WRITE.
Historically, we had problem for some of these behaviors on some
backends, so let's make sure that such behaviors don't come back.
|
|
8bc1e3d6
|
2010-05-26T13:19:08
|
|
Remove all non-error prints from test/regress.c
Now, running ./test/regress --quiet will indeed only inform you
about errors. Previously, it would also spew extra output.
|
|
e73f1d79
|
2010-05-26T13:18:30
|
|
Remove the now-obsolete setup_test() and cleanup_test() functions
|
|
f37cd4c2
|
2010-04-21T12:25:29
|
|
Detect broken unsetenv at unit-test runtime
If we have an unsetenv function that doesn't work, we can't run the
main/base_environ unit test, so we should skip it.
|
|
c16e6844
|
2010-05-04T13:27:36
|
|
Rename current_base symbol to event_global_current_base_
The "current_base" symbol was never actually declared in an exported
header; it's hideously deprecated, and it was the one remaining
exported symbol (fwict) that was prefixed with neither ev nor
bufferevent nor _ev nor _bufferevent.
codesearch.google.com turns up no actual attempts to use our
current_base from outside libevent.
|
|
899c1dcc
|
2010-04-14T15:42:57
|
|
Replace EVUTIL_CLOSESOCKET macro with a function
The EVUTIL_CLOSESOCKET() macro required you to include unistd.h in your
source for POSIX. We might as well turn it into a function: an extra
function call is going to be cheap in comparison with the system call.
We retain the EVUTIL_CLOSESOCKET() macro as an alias for the new
evutil_closesocket() function.
(commit message from email by Nick and Sebastian)
|
|
b557b175
|
2010-03-21T13:28:48
|
|
Detect and refuse reentrant event_base_loop() calls
Calling event_base_loop on a base from inside a callback invoked by
that same base, or from two threads at once, has long been a way to
get exceedingly hard-to-diagnose errors. This patch adds code to
detect such reentrant invocatinos, and exit quickly with a warning
that should explain what went wrong.
|
|
33874b05
|
2010-03-16T13:37:15
|
|
Make 'main/many_events' test 70 fds, not 64.
This is mainly intended to ensure that we don't get hung up on
the 64-handle limit that lots of O(n) Windows functions (but FWICT
not select) like to enforce.
|
|
68dc742b
|
2010-03-12T20:38:25
|
|
Fix a write of uninitialized RAM in regression tests
Not actually harmful, but not something we should be doing.
Found by valgrind.
|
|
c7cf6f00
|
2010-03-05T12:47:46
|
|
Replace users of "int fd" with "evutil_socket_t fd" in portable code
Remeber, win32 has a socket type that's actually a handle, so if
there's a chance that code is run on win32, we can't use "int" as the
socket type.
This isn't a blind search-and-replace: sometimes an fd is really in
fact for a file, and not a socket at all.
|
|
17efc1cd
|
2010-03-04T01:25:51
|
|
Update all our copyright notices to say "2010"
|
|
7ffd3875
|
2010-02-24T13:40:06
|
|
Delete stack-alloced event in new unit test before returning.
|
|
8fcb7a1b
|
2010-02-23T23:55:32
|
|
Add test for periodic timers that get activated for other reasons
This was already independently verified by the new bufferevent
timeout tests, but it's good to explicitly check that our code
does what it should.
|
|
4faeaea9
|
2010-02-19T03:39:50
|
|
Clean up formatting: function/keyword spacing consistency.
- Keywords always have a space before a paren. Functions never do.
- No more than 3 blank lines in a row.
|
|
e5bbd40a
|
2010-02-18T17:41:15
|
|
Clean up formatting: use tabs, not 8-spaces, to indent.
|
|
918e9c5e
|
2010-01-23T16:38:36
|
|
Fix a number of warnings from gcc -pedantic
|
|
7296971b
|
2009-12-29T16:38:03
|
|
Detect setenv/unsetenv; skip main/base_environ test if we can't fake them.
Previously, we assumed that we would have setenv/unsetenv everywhere
but WIN32, where we could fake them with putenv. This isn't so: some
other non-windows systems lack setenv/unsetenv, and some of them lack
putenv too.
The first part of the solution, then, is to detect setenv/unsetenv/
putenv from configure.in, and to fake setenv/unsetenv with putenv
whenever we have the latter but not one of the former.
But what should we do when we don't even have putenv? We could do
elaborate tricks to manipulate the environ pointer, but since we're
only doing this for the unit tests, let's just skip the one test in
question that uses setenv/unsetenv.
|
|
d84d8385
|
2009-11-27T15:24:32
|
|
Fix two use-after-free bugs in unit tests spoted by lock debugging
|
|
9bf124bf
|
2009-11-18T21:16:47
|
|
Build correctly with mm replacement turned off.
svn:r1547
|
|
b2fe4aed
|
2009-11-09T18:36:34
|
|
Unit tests for got_break and got_exit.
svn:r1521
|
|
693c24ef
|
2009-11-09T17:16:30
|
|
Implement queued timeouts for case where many timeouts are the same.
Libevent's current timeout code is relatively optimized for the
randomly scattered timeout case, where events are added with their
timeouts in no particular order. We add and remove timeouts with
O(lg n) behavior.
Frequently, however, an application will want to have many timeouts
of the same value. For example, we might have 1000 bufferevents,
each with a 2 second timeout on reading or writing. If we knew this
were always the case, we could just put timeouts in a queue and get
O(1) add and remove behavior. Of course, a queue would give O(n)
performance for a scattered timeout pattern, so we don't want to
just switch the implementation.
This patch gives the user the ability to explicitly tag certain
timeout values as being "very common". These timeout values have a
cookie encoded in the high bits of their tv_usec field to indicate
which queue they belong on. The queues themselves are each
triggered by an entry in the minheap.
See the regress_main.c code for an example use.
svn:r1517
|
|
784b8773
|
2009-11-06T21:46:57
|
|
We do not work any more without an event-config.h; stop pretending that it is meaningful to check for HAVE_CONFIG_H
svn:r1516
|
|
0fd0255f
|
2009-11-03T19:54:56
|
|
Remove compat/sys/_time.h
I've gone through everything that it declared to see where it was used,
and it seems that we probably don't need it anywhere.
Here's what it declared, and why I think we're okay dropping it.
o struct timeval {}
(Used all over, and we can't really get away with declaring it ourselves;
we need the same definition the system uses. If we can't find struct
timeval, we're pretty much sunk.)
o struct timespec {}
(Used in event.c, evdns.c, kqueue.c, evport.c. Of these,
kqueue.c and event.c include sys/_time.h. event.c conditions its use on
_EVENT_HAVE_CLOCK_GETTIME, and kqueue() only works if timespec is defined.)
o TIMEVAL_TO_TIMESPEC
(Used in kqueue.c, but every place with kqueue has sys/time.h)
o struct timezone {}
(event2/util.h has a forward declaration; only evutil.c references it and
doesn't look at its contents.)
o timerclear, timerisset, timercmp, timeradd, timersub
(Everything now uses the evutil_timer* variants.)
o ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF, struct itemerval
(These are only used in test/regress.c, which does not include _time.h)
o CLOCK_REALTIME
(Only used in evdns.c, which does not include _time.h)
o TIMESPEC_TO_TIMEVAL
o DST_*
o timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub
o struct clockinfo {}
o CLOCK_VIRTUAL, CLOCK_PROF
o TIMER_RELTIME, TIMER_ABSTIME
(unused)
svn:r1494
|
|
96c6956e
|
2009-10-30T22:43:30
|
|
Add a "many events" regression test.
This is a glass-box test to get more coverage on the event loop
backends. We've run into bugs here before with fencepost errors, and
it turns out that none of our unit tests had enough events to
exercise the resize code.
Most of the backends have some kind of logic that resizes an array
when:
- The highest fd is too high
- The number of events added since the last iteration of the loop
is too high
- The number of active events is too high.
This test hits all 3 cases, and increases coverage in select.c by 7%,
in poll by 1%, and in kqueue by 9%.
svn:r1482
|
|
5b3fb5bf
|
2009-10-29T16:35:20
|
|
More documentation and unit tests for event_tagging.
svn:r1476
|
|
904b5721
|
2009-10-27T06:47:25
|
|
Avoid calling exit() during event_base_new*()
Previously, each of the three make-an-event-base functions would exit
under different, weird circumstances, but return NULL on others.
- All three would exit on OOM sometimes.
- event_base_new() and event_init() would die if all backends were
disabled.
- None of them would die if the socketpair() call failed.
Now, only event_init() exits on failure, and it exits on every kind of
failure. event_base_new() and event_base_new_with_config() never do.
svn:r1472
|
|
e9ee1057
|
2009-10-27T04:25:45
|
|
Give event_assign a return value, and make it less inclined to exit().
We also refactor event_assign so that it is the core function, and
event_set() is only the wrapper.
svn:r1469
|
|
ba8a1771
|
2009-10-02T03:03:58
|
|
Do not notify the main thread more than needed.
Basically, we suppress the notification when an event is added or deleted
and:
- The event has no fd, or there is no change in whether we are
reading/writing on the event's fd.
- The event has no timeout, or adding the event did not make the earliest
timeout become earlier.
This should be a big efficiency win in applications with multiple threads and
lots of timeouts.
svn:r1439
|
|
8cc68835
|
2009-07-25T03:35:32
|
|
Fix the main/methods unit test to pass from "make verify".
The problem was introduced when we changed the semantics of
get_supported_methods() to reflect all the methods that exist.
Previously, it had not returned methods disabled from the environment,
but the test didn't know that.
svn:r1379
|
|
49de08ef
|
2009-07-21T19:20:44
|
|
Push coverage of event.c a little higher
svn:r1373
|
|
f4775918
|
2009-07-20T14:55:51
|
|
Refactor evtag tests into their own suite.
svn:r1366
|
|
e8400a43
|
2009-07-20T14:55:35
|
|
Rename encode_int(64) to avoid polluting the global namespace.
They're now called evtag_encode_int(64). The old names are available
as macros in event2/tag_compat.h.
Also, add unit tests for encode/decode_int64.
svn:r1365
|
|
5d71b25b
|
2009-07-17T18:38:38
|
|
Remove all trailing whitespace from end-of-line.
svn:r1350
|
|
d4e3671f
|
2009-07-17T18:38:21
|
|
Add a test to free_active_base to free a base with an active event.
svn:r1349
|
|
e224321c
|
2009-07-14T18:49:42
|
|
Convert and expand free_active_base/event_base_new tests to avoid dbl-free. Patch from Zack Weinberg
svn:r1342
|
|
b45cead7
|
2009-04-30T18:05:33
|
|
Make environment-variable tests work on win32, which has only one method and lacks (un)setenv.
svn:r1253
|
|
586aa468
|
2009-04-28T19:08:27
|
|
Unit test for disabling events with EVENT_NO*, and for EVENT_BASE_FLAG_IGNORE_ENV.
svn:r1247
|
|
d70b0804
|
2009-04-23T18:08:42
|
|
Make main/methods test pass on systems where only one backend exists.
svn:r1235
|
|
0068c98a
|
2009-04-23T00:01:14
|
|
Make version test ignore the bottom byte of the version number.
svn:r1225
|
|
b21be245
|
2009-04-23T00:00:55
|
|
Somehow free_active_base was using the socketpair, but not saying it needed it. How did this ever work?
svn:r1223
|
|
1f9c9e51
|
2009-04-22T15:38:50
|
|
Add a missing "static".
svn:r1219
|
|
133a015d
|
2009-04-21T18:48:05
|
|
Make sure the test case for mem_functions hits strdup too.
svn:r1218
|
|
7f1855d0
|
2009-04-21T18:47:35
|
|
Add a basic test for set_mem_functions
svn:r1216
|
|
386279d0
|
2009-04-21T18:47:02
|
|
Add a test for event_pending; especially the timeout part.
svn:r1214
|
|
ff1f4295
|
2009-04-21T18:46:43
|
|
Unit tests for event_base_once.
svn:r1213
|
|
ea664bf2
|
2009-04-21T18:46:30
|
|
Refactor test wrappers to divide legacy items from useful stuff.
svn:r1212
|
|
122e934e
|
2009-04-21T18:46:11
|
|
Add unit tests for version methods and feature-based backend selection
svn:r1211
|
|
7cf8a7b0
|
2009-04-21T18:45:59
|
|
Call the main testcases "main", not "legacy".
svn:r1210
|
|
a8f6d961
|
2009-04-17T06:56:09
|
|
Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h
svn:r1183
|
|
68d0139f
|
2009-04-07T04:49:25
|
|
Refactor the zlib and pthreads tests to appear in the regular tinytest tree structure.
svn:r1141
|
|
71604d85
|
2009-02-10T19:38:25
|
|
Remove some needless includes
svn:r1104
|
|
f9e4e0f9
|
2009-02-03T18:28:53
|
|
Move bufferevent tests to regress_bufferevent.c file.
svn:r1101
|
|
ea4b8724
|
2009-02-02T19:22:13
|
|
checkpoint work on big bufferevent refactoring
svn:r1095
|
|
a30c9eb1
|
2009-02-01T01:07:12
|
|
Move evbuffer tests into their own file.
svn:r1087
|
|
12e8db5b
|
2009-01-31T18:36:47
|
|
Convert evtag test.
svn:r1085
|
|
5831d11a
|
2009-01-31T18:36:37
|
|
Move rpc_test to regress_rpc.
svn:r1084
|
|
fa6ae169
|
2009-01-31T18:36:24
|
|
Convert RPC suite. There are still some places it can exit(1), but those always run forked, so no big deal.
svn:r1083
|
|
eac75f91
|
2009-01-31T07:32:14
|
|
Port DNS tests.
svn:r1081
|
|
153093ec
|
2009-01-30T17:44:13
|
|
Port the HTTP unit tests. Most are still legacy (since they use test_ok so much), but at least they no longer exit(1) on failure
svn:r1076
|
|
241690b2
|
2009-01-30T17:43:59
|
|
Move util tests to regress_util.c
svn:r1075
|
|
4e9470b4
|
2009-01-30T17:43:48
|
|
Convert test_evutil_strtoll to new framework.
svn:r1074
|
|
a8203b34
|
2009-01-29T23:19:57
|
|
Refactor unit tests using my spiffy new "tinytest" framework.
The big win here is that we can get process-level isolation.
This has been tested to work okay on at least Linux and Win32. Only
the tests in regress.c have been converted wrapped in the new wrapper
functions; the others are still on the old system.
svn:r1073
|
|
cc7a53c1
|
2009-01-29T18:15:36
|
|
fix signed/unsigned warning in unit tests. can we just use "char*" on all new APIs? this void/unsigned char*/char* business is awful.
svn:r1071
|
|
7dd362b1
|
2009-01-29T15:09:24
|
|
Have util-internal.h define socklen_t if we need it, and include it appropriately. This fixes win32 compilation.
svn:r1070
|
|
66b2a7ff
|
2009-01-29T03:20:40
|
|
test evbuffer_add_reference
svn:r1068
|
|
b85b710c
|
2009-01-27T22:34:36
|
|
Update copyright statements to reflect the facts that:
a) this is 2009
b) niels and nick have been comaintainers for a while
c) saying "all rights reserved" when you then go on to explicitly
disclaim some rights is sheer cargo-cultism.
svn:r1065
|
|
8889a770
|
2009-01-27T22:30:46
|
|
Replace all use of config.h with event-config.h.
svn:r1064
|
|
9993137c
|
2009-01-27T21:10:31
|
|
Remove all trailing whitespace in all the source files.
svn:r1063
|
|
30653899
|
2009-01-27T16:35:28
|
|
make it so that test_persistent_timeout can call loopexit only once; reported by Alexander Drozdov
svn:r1062
|