|
0bffe43a
|
2010-08-09T12:08:40
|
|
Fix a nasty dangling-event bug when using rate-limiting groups
When we freed a bufferevent that was in a rate-limiting group and
blocked on IO, the process of freeing it caused it to get removed
from the group. But removing the bufferevent from the group made
its limits get removed, which could make it get un-suspended and in
turn cause its events to get re-added. Since we would then
immediately _free_ the events, this would result in dangling
pointers.
Fixes bug 3041007.
|
|
ff481a8e
|
2010-08-06T23:22:01
|
|
Increment vesion to 2.0.6-rc-dev
|
|
556d0f40
|
2010-08-06T21:19:44
|
|
Increment versions to 2.0.6-rc
|
|
f6582640
|
2010-08-06T21:11:01
|
|
Changlog and new acknowledgements for 2.0.6-rc
|
|
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.
|
|
5fa30d2b
|
2010-08-06T17:13:27
|
|
Fix evdns build with -DUNICODE
It turns out that GetProcAddress always takes its second argument as
a C string, regardless of whether unicode is on or not.
|
|
28f31a4f
|
2010-08-06T16:36:23
|
|
Fix unit tests with -DUSE_DEBUG enabled
If you were to enable USE_DEBUG and slog through all 700+ MB of
debugging output, you'd find that one of the unit tests failed,
since it tested the debug logging code, but the string it expected
and the string it logged differed by a tab vs 2 spaces.
|
|
ea1ea3d6
|
2010-08-06T13:34:51
|
|
Make test-changelist count cpu usage right on win32
|
|
9b602096
|
2010-08-06T13:03:17
|
|
Use AF_INET socketpair to test sendfile on Solaris
|
|
57b30cd7
|
2010-08-06T13:01:32
|
|
Turn our socketpair() replacement into its own function
This patch splits the formerly windows-only case of evutil_socketpair()
into an (internal-use-only) function named evutil_ersatz_socketpair(), and
makes it build and work right on non-Windows hosts.
We need this for convenience to test sendfile on solaris, where socketpair
can't give you an AF_INET pair, and sendfile() won't work on AF_UNIX.
|
|
de1f5d6d
|
2010-08-06T09:33:55
|
|
Remember to initialize timeout events for bufferevent_async
Fixes segfaults in unit tests.
|
|
170ffd2b
|
2010-08-05T15:57:30
|
|
Increase the tolerance in our unit tests for sloppy clocks.
(Apparently openbsd in virtualbox just doesn't keep very accurate time.)
|
|
e996b3d4
|
2010-08-05T15:51:16
|
|
Make tests quieter on local dns resolver failure
|
|
4558ce23
|
2010-08-04T17:31:28
|
|
Merge branch 'openssl_ratelim'
|
|
b2c6202d
|
2010-08-04T15:52:32
|
|
Fix an assertion bug in test-ratelim
If the rate limit was low enough, then the echo_conns wouldn't finish
inside the 300 msec we allowed for them to close. Instead, count the
number of connections we have, and keep waiting until they are all
closed.
|
|
42f6b624
|
2010-08-04T15:51:14
|
|
Add option to test-ratelim to test min_share
|
|
6ae53d67
|
2010-08-04T15:44:08
|
|
Add an interface to expose min_share in ratelimiting groups
|
|
009f3005
|
2010-08-04T14:54:38
|
|
Fix rate-limit calculation on openssl bufferevents.
When you're doing rate limiting on an openssl connection, you nearly
always want to limit the number of bytes sent and received over the
wire, not the number of bytes read or written over the secure
transport.
|
|
13b912e4
|
2010-08-01T21:39:48
|
|
Fixed compilation of sample/le-proxy.c on win32
|
|
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).
|
|
840a72fb
|
2010-07-29T20:32:40
|
|
Fix badly-behaved subtest of dns/bufferevent_connect_hostname
The bufferevent_connect_hostname test was specifying AF_INET, but the
gethostbyname test we were using to see what error to expect was using
PF_UNSPEC, leading to possible divergence of results.
|
|
9e725f72
|
2010-07-29T18:12:05
|
|
Improve error message for failed epoll to make debugging easier.
|
|
cc2379d2
|
2010-07-26T14:48:32
|
|
Constify a couple of arguments to evdns_server_request_add_*_reply
|
|
e1c1167c
|
2010-07-22T14:38:08
|
|
Replace (unused,always 0) is_tcp argument to evdns_add_server_port*() with flags
Since we weren't using it for anything, and we always failed if it was
set, we're allowed to change the future semantics of setting it.
|
|
7e87a599
|
2010-07-21T14:33:42
|
|
Stop asserting when asked for a (unsupported) TCP dns port. Just return NULL.
|
|
c9913174
|
2010-07-19T15:31:19
|
|
Change bufferevent_openssl::do_write so it doesn't call SSL_write with a 0 length buffer
I was running into a problem when using bufferevent_openssl with a
very simple echo server. My server simply bufferevent_read_buffer 'd
data into an evbuffer and then passed that evbuffer straight to
bufferevent_write_buffer.
The problem was every now and again the write would fail for no
apparent reason. I tracked it down to SSL_write being called with the
amount of data to send being 0.
This patch alters do_write in bufferevent_openssl so that it skips
io_vecs with 0 length.
|
|
7c926916
|
2010-07-19T15:14:10
|
|
Make test/test.sh call test-changelist
Eventually test-changelist should expand to try more cases, maybe
query the status of the actual changelist somehow, and integrate it
with the rest of the unit tests.
Also, add test-changelist to gitignore.
|
|
cb927a51
|
2010-07-19T15:03:43
|
|
Fix whitespace.
|
|
b00d4c04
|
2010-07-19T14:58:08
|
|
Remove unused variables in test/test-changelist.c
|
|
cf249e7d
|
2010-07-19T13:44:56
|
|
Possible fix to 100% cpu usage with epoll and openssl
I'm running a fairly simple bit of test code using libevent2 with epoll and
openssl bufferevents and I've run into a 100% cpu usage problem.
Looking into it 100% usage was caused by epoll_wait constantly
returning write events on the openssl socket when it shouldn't really have
been looking for write events at all (N_ACTIVE_CALLBACKS() was returning 0
also).
Looking a bit deeper eventbuffer_openssl socket seems to be requesting
that the EV_WRITE event be removed when it should, but the event isn't
actually being removed from epoll.
Continuing to follow this I think I've found a bug in
event_changelist_del.
For evpoll event_del calls event_changelist_del which caches the change
which is then actioned later when evpoll_dispatch is called.
In event_changlist_del there is a check so that if the currently changed
action is an add then the cached action is changed to a no-op rather than a
delete (which makes sense). The problem arises if there are more than
two add or delete operations between calls to dispatch, in this case it's
possible that the delete is turned into a no-op when it shouldn't have
been.
For example starting with the event on, a delete followed by an add and
then another delete results in a no-op when it should have been a delete (I
added a fair bit of debug output that seems to confirm this behaviour).
I've applied a small change that checks the original old_event stored with
the change and only converts the delete to a no-op if the event isn't on in
old_event. This seems to have fixed my problem.
|
|
928b7d49
|
2010-07-16T12:38:23
|
|
Merge branch 'pncalls_fix'
|
|
65abdc20
|
2010-07-16T09:11:09
|
|
Fix wrong sie calculation of iovec buffers when exact=1
The old code had a bug where the 'exact' flag to 1 in
_evbuffer_read_setup_vecs would never actually make the iov_len field
of the last iovec get truncated. This patch fixes that.
|
|
7c2dea16
|
2010-07-13T11:06:08
|
|
Pass flags to fcntl(F_SETFL) and fcntl(F_SETFD) as int, not long
Everybody but Linux documents this as taking an int, and Linux is
very tolerant of getting an int instead. If it weren't, everybody
doing fcntl(fd,F_SETFL,O_NONBLOCK) would break, since the glibc
headers define O_NONBLOCK as an int literal.
|
|
e73cbde1
|
2010-07-08T14:41:02
|
|
Suppress a spurious EPERM warning in epoll.c
It's okay for us to get an EPERM when doing an EPOLL_DEL on an fd; it
just means that before we got a chance to the EPOLL_DEL, we closed the
fd and reopened a new non-socket that wound up having the same fd.
Partial fix for Bug 3019973.
|
|
fc5e0a23
|
2010-07-05T14:39:39
|
|
Don't race when calling event_active/event_add on a running signal event
There was previously no lock protecting the signal event's
ev_ncalls/ev_pncalls fields, which were accessed by all of
event_signal_closure, event_add_internal, event_del_internal, and
event_active_nolock. This patch fixes this race by using the
current_event_lock in the same way it's used to prevent
event_del_internal from touching an event that's currently running.
|
|
61e1eeec
|
2010-07-05T13:24:45
|
|
Tidy up the code in evthread_make_base_notifiable a little
Previously, we had a few conditional statements with the "if (...)"
inside an #ifdef and the body outside. That kind of thing is hard to
read.
|
|
a5bc15b2
|
2010-07-05T13:24:12
|
|
Drain th_notify_fd[0] more bytes at a time.
|
|
17522d2a
|
2010-07-05T13:17:47
|
|
Fix a deadlock related to event-base notification. Diagnosed by Zhou Li, Avi Bab, and Scott Lamb.
The problem was that the thread doing the notification could block on
write in evthread_notify_base_default while holding the th_base_lock.
The main thread would never drain th_notify_fd[0], since it would need
th_base_lock to actually trigger events.
|
|
d89fdba4
|
2010-07-05T12:28:22
|
|
Make sample/hello_world work on windows
We forgot to include the WSAStartup call in main().
Patch from an anonymous user on Sourceforge.
Fixes bug 3025354.
|
|
08598709
|
2010-07-05T12:26:21
|
|
never let bufferevent_rlim functions return negative
|
|
14250031
|
2010-06-23T01:15:15
|
|
Really only add libevent_core.la to LIBADD on mingw
Commit fdc629736e1 tried to do this, but added it for mingw and
for everything else. Fixes a segfault in bufferevent unittests.
|
|
215e629c
|
2010-06-21T12:26:21
|
|
Add bufferevent_lock()/bufferevent_unlock()
Although bufferevent operations are threadsafe, sometimes you need
to make sure that a few operations on a single bufferevent will all
be executed with nothing intervening. That's what these functions
are for.
|
|
7b259b67
|
2010-06-21T12:24:49
|
|
Fix sentence fragment in docs for event_get_struct_event_size()
|
|
7510aac3
|
2010-06-21T12:23:32
|
|
Unit test for event_get_struct_event_size()
|
|
9659eced
|
2010-06-19T18:23:16
|
|
Add a comment to describe our plan for library versioning
|
|
b2d7440a
|
2010-06-19T18:22:48
|
|
Set library version for libevent_pthreads correctly
|
|
e21f5d15
|
2010-06-19T18:21:40
|
|
Document a change in the semantics of event_get_struct_event_size()
|
|
8a440623
|
2010-06-17T10:33:06
|
|
Have autogen.sh pass --force-missing to automake
Previously, our autogen.sh script wouldn't tell automake to update
older versions of its copied-in scripts, which would cause problems if
they got sufficiently out-of-date.
|
|
9b149116
|
2010-06-17T10:31:35
|
|
Remove some automake-generated files from version control.
|
|
276e7ee9
|
2010-06-11T11:57:13
|
|
Fix a pedantic gcc 4.4 warning in event2/event.h
|
|
29b2e233
|
2010-05-30T03:17:48
|
|
Fix possible nullptr dereference in evhttp_send_reply_end()
(The existing implementation had sanity-checking code for the case where
its argument was NULL, but it erroneously dereferenced it before actually
doing the sanity-check. --nickm)
|
|
17a8e2d7
|
2010-06-07T12:06:43
|
|
Add a function to retrieve the other side of a bufferevent pair
|
|
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.
|
|
3467f2fa
|
2010-05-28T15:05:32
|
|
Fix logic in correcting high values from FIONREAD
The old logic made sense back when buffer.c was an enormous linear
buffer, but it doesn't make any sense for the chain-based
implementation.
This patch also refactors the ioctl{socket}? call into its own function.
|
|
0798dd12
|
2010-05-27T22:37:09
|
|
Close the file in evutil_read_file whether there's an error or not.
evutil_read_file would close the file if there was an error, but not if things went normally.
|
|
c21c6631
|
2010-05-27T01:32:11
|
|
Add the libtool-generated /m4/* stuff to .gitignore
|
|
39906698
|
2010-05-26T12:58:02
|
|
Let evhttp_send_error infer the right error reasons
|
|
06bd0563
|
2010-05-26T12:50:59
|
|
Fix the default HTTP error template
The current template...
<HTML><HEAD><TITLE>%s</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
Invalid method in request<P>
</BODY></HTML>
is highly confusing. The given title is easily overlooked and the
hard-coded content is just plain wrong in most cases (I really read
this as "the server did not understand the requested HTTP method)
This patch changes the template to include the error reason in the
body as well as in the header, and to infer the proper reason from
the status code whenever the reason argument is NULL.
This patch also removes a redundant evhttp_add_header from
evhttp_send_error; evhttp_send_page already adds a "Connection:
close" header.
|
|
3689bd2d
|
2010-05-26T13:32:32
|
|
Have the unit tests report errors from test.sh
The default behavior of test.sh was to suppress all output from
test/regress, and say nothing but OKAY or FAILED. This wasn't so good
for getting bugs reported, since lots of people didn't know to set
TEST_OUTPUT_FILE, or re-run ./test/regress on its own.
Now, when you don't specify an output file for test.sh, it runs
regress with the --quiet option. This option makes the unit tests
only print output on failure, which is what we probably wanted.
|
|
faf2a04f
|
2010-05-26T13:31:41
|
|
Make test.sh exit with nonzero status if tests fail
This behavior makes "make verify" actually fail when the tests fail,
which is what it's supposed to do.
|
|
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
|
|
899b0a39
|
2010-05-24T15:24:03
|
|
Use generic win32 interfaces, not ASCII-only ones, where possible.
|
|
4ff247b2
|
2010-05-19T10:49:49
|
|
Merge branch 'evdns_no_empty_handles'
|
|
47c5dfbe
|
2010-05-18T17:28:51
|
|
Remove some dead assignments
|
|
b14f151b
|
2010-05-18T17:27:06
|
|
If no evdns request can be launched, return NULL, not a handle
Some of our evdns code was willing to return an evdns_request with
handle->current_req set to NULL. Really, those cases should just
return NULL.
|
|
d14bb926
|
2010-05-18T14:05:01
|
|
Use -Wlogical-op on gcc 4.5 or higher
It exposed one bug for us (see 8c3452bcb294e07888), and might
prevent more.
|
|
8c3452bc
|
2010-05-18T13:55:32
|
|
Correctly recognize .255 addresses as link-local when looking for interfaces
|
|
bda21e7f
|
2010-05-17T11:58:07
|
|
Avoid close of uninitialized socket in evbuffer unit test
Attempts to fix a crash bug found by Brodie Thiesfield.
|
|
caca2f45
|
2010-05-14T14:36:49
|
|
Replace (safe) use of strcpy with memcpy to appease OpenBSD
If Libevent uses strcpy, even safely, it seems OpenBSD's linker will
complain every time a library links Libevent. It's easier just not to
use the old thing, even when it's safe to do so.
|
|
75701e89
|
2010-05-14T14:30:09
|
|
Add some missing includes to fix Linux build again
|
|
b5bfc44d
|
2010-05-13T15:38:39
|
|
Make test-ratelim clean up after itself better.
|
|
6d195109
|
2010-05-13T14:59:33
|
|
Avoid event_del on uninitialized event in event_base_free
This was mostly harmless, since the event was cleared with calloc, but
still it's not a correct thing to do.
|
|
2b44dcca
|
2010-05-13T12:01:30
|
|
Add options to test-ratelim.c to check its results
The new options let you specify a maximum deviation of bandwidth used
from expected bandwidth used, and make test-ratelim.c exit with a
nonzero status when those deviations are violated.
This patch also adds a test-ratelim.sh script to run test-ratelim with
a few sensible options for testing.
|
|
218a3c37
|
2010-05-13T11:24:07
|
|
Do not check that event_base is set in EVBASE_ACQUIRE_LOCK
In every place that we call EVBASE_ACQUIRE_LOCK, the base is either
set, or must be set, so the test is redundant.
|
|
fdfc3fc5
|
2010-05-13T11:23:12
|
|
Remove the now-unusable EVTHREAD_LOCK/UNLOCK constants
|
|
33bbbed9
|
2010-05-13T10:57:30
|
|
Mark the event_err() functions as __attribute__((noreturn))
This attribute tells gcc (and anything else that understands gcc
attributes) that the functions will never return control, and helps
the optimizer a little. With luck, it will also tell
less-than-full-program dataflow analysis tools that they don't need to
worry about any code path that involves calling one of these functions
and then returning.
This patch also forces event_exit() to always exit, no matter what the
user-supplied fatal_callback does. This means that the old unit tests
for the event_err* functions don't work any more, since they assume it
is safe to call event_err* if you've given it a bogus fatal_callback
that doesn't exit. Instead, we have to make the unit tests fork
before calling event_err(), and have the main unit test process wait
for the event_err() test to exit with a sane exit code. On unix,
that's trivial. On windows, let's not bother and just assume that
event_err* works.
|
|
dfb75ab2
|
2010-05-12T15:38:28
|
|
Test the unlocked-deferred callback case of bufferevents
|
|
c5bab560
|
2010-05-11T11:44:07
|
|
Remove the obsolete evthread interfaces
These were added in 2.0.1, and deprecated in 2.0.4 and 2.0.5; we've
promised that they would be removed, and warned whenever they were
invoked. Users should call evthread_set_lock_callbacks instead... or
ideally just call evthread_use_windows_threads or
evthread_use_pthreads.
|
|
9cb5bc86
|
2010-05-10T14:51:32
|
|
Bump version to 2.0.5-beta-dev
|
|
ad9b7f15
|
2010-05-09T00:22:08
|
|
Increment version numbers for 2.0.5-beta
|
|
f6aaf176
|
2010-05-09T00:16:35
|
|
Add a changelog for 2.0.5-beta
|
|
7c519dfd
|
2010-05-08T23:29:29
|
|
Fix some autoconf issues on OpenBSD
Issue 1: autoconf gets accept when a header works properly with cpp
but not with cc. This was true of the sys/sysctl.h header on
openbsd. The fix: include sys/param.h (if present) when testing for
sys/sysctl.h
Issue 2: Somehow, autoconf's macro generation code is messed up on
some versions of openbsd (including mine, and other people's too) so
that instead of SIZEOF_VOID_P, it makes SIZEOF_VOID__.
evutil/util.h now works around that.
|
|
c1cd32a1
|
2010-05-08T22:21:52
|
|
Define _REENTRANT as needed on Solaris, elsewhere
It turns out that _REENTRANT isn't only needed to make certain
functions visible; we also need it to make pthreads work properly
some places (like Solaris, where forgetting _REENTRANT basically
means that all threads are sharing the same errno). Fortunately,
our ACX_PTHREAD() configure macro already gives us a PTHREAD_CFLAG
variable, so all we have to do is use it.
|
|
3d9e05b1
|
2010-05-08T19:56:25
|
|
Fix test.sh on freebsd
It turns out that in all conformant shells, "unset FOO" removes FOO
both from the shell's variables and from the exported environment.
(I've tested this on msys, opensolaris, linux, osx, and freebsd.)
And in nearly every shell I can find, "unset FOO; export FOO" does
the same as unset FOO... except in my FreeBSD VM, where the "export
FOO" sets the exported value of FOO equal to "". This broke test.sh
for us.
The fix is simple: remove the needless exports!
|
|
0ee6f6ce
|
2010-05-08T18:00:26
|
|
Make test.sh support mingw/msys on win32
This required:
- Adding another WIN32 section in test.sh
- not running "touch /dev/null"
- calling WSAStartup in all the test binaries
- Fixing a dumb windows-only bug in test-time.c
|
|
935e1504
|
2010-05-08T19:36:05
|
|
Fix whitespace in evutil.c
|
|
35570716
|
2010-05-08T19:16:47
|
|
Fix another nasty solaris getaddrinfo() behavior
Everybody else thinks that when you getaddrinfo() on an ip address
and don't specify the protocol and the socktype, it should give you
multiple answers , one for each protocol/socktype implementation.
OpenSolaris takes a funny view of RFC3493, and leaves the results set
to 0.
This patch post-processes the getaddrinfo() results for consistency.
|
|
2cf2a286
|
2010-04-21T11:57:55
|
|
Fix getaddrinfo with protocol unset on Solaris 9. Found by Dagobert Michelsen
Apparently when you call Solaris 9's getaddrinfo(), it likes to leave
ai_protocol unset in the result. This is no way to behave, if I'm
reading RFC3493 right.
This patch makes us check for a getaddrinfo() that's broken in this way,
and work around it by trying to infer socktype and protocol from one
another.
Partial bugfix for 2987542
|
|
c44de06c
|
2010-05-08T18:09:27
|
|
Numerous opensolaris compilation fixes
For future note, opensolaris doesn't have sys/sysctl.h, doesn't like
comparing iov_buf to a chain_space_ptr without a cast, and is (predictably)
unforgiving of dumb syntax errors.
Also, we had accidentally broken the devpoll backend test in configure.in
|
|
f89168e7
|
2010-05-08T19:11:50
|
|
Make test for bufferevent_connect_hostname system-neutral
Previously, the be5_outcome field for the dns error would be set to
something dependent on our system resolver. It turns out that you
can't rely on nameservers to really give you an NEXIST answer for
xyz.example.com nowadays: too many of them are annoyingly broken and
like to redirect you to their locked-in portals. This patch changes
the bufferevent_connect_hostname test so that it makes sure that the
dns_error of be5_outcome is "whatever you would get from resolving
the target hostname"
|
|
88a543fc
|
2010-05-08T19:09:09
|
|
Make unit test for add_file able to tell "error" from "done"
Importantly, we don't actually want to call evbuffer_write() when
the buffer is empty. This makes it an error to ever get a -1 return
value from evbuffer_add_file(), which makes it safe for us to test
the return value.
|
|
384d1245
|
2010-05-08T17:15:52
|
|
Fix bench_http build on win32.
|
|
05de45d6
|
2010-05-08T16:47:07
|
|
add more (currently skipped) add_file tests on win32
|
|
ad811cdc
|
2010-05-08T16:41:01
|
|
Fix unused-variable warning when building with threads disabled
|
|
dcdae6b7
|
2010-05-08T16:34:18
|
|
Make evbuffer_add_file() work on windows
Right now only the add_file() mode is supported, when it would be
nicer to have mmap support. Perhaps for Libevent 2.1.x.
|
|
b4f12a17
|
2010-05-08T14:49:59
|
|
Implement regress_make_tempfile on win32 to test evbuffer_add_file
(Conclusion: evbuffer_add_file is broken on win32, since it
uses recv on a file.)
|
|
90d42251
|
2010-05-08T15:31:54
|
|
Fix some crazy macro mistakes in arc4random.c
|
|
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.
|
|
fdc62973
|
2010-05-06T14:37:23
|
|
Only add libevent_core.la to LIBADD on mingw
Chris Davis reports that this is also necessary to fix building with
shared libraries on OSX for him. Should fix bug 2997775.
There is probably a better fix for the issues solved by commit
3cbca8661f, but for now, we're trying to get a beta out the door.
|