|
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.
|
|
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.
|
|
e73f1d79
|
2010-05-26T13:18:30
|
|
Remove the now-obsolete setup_test() and cleanup_test() functions
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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.)
|
|
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.
|
|
a62c8433
|
2010-05-06T14:16:50
|
|
Merge commit 'chrisd/connect-hostname-report-err'
|
|
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.
|
|
cb670740
|
2010-04-28T11:51:56
|
|
Make debug mode catch mixed ET and non-ET events on an fd
Of the backends that support edge-triggered IO, most (all?) do not
support attempts to mix edge-triggered and level-triggered IO on the
same FD. With debugging mode enabled, we now detect and refuse attempts
to add a level-triggered IO event to an fd that already has an
edge-triggered IO event, and vice versa.
|
|
0ef40706
|
2010-04-24T00:06:38
|
|
Report DNS error when lookup fails during bufferevent_socket_connect_hostname.
|
|
96730d31
|
2010-04-23T23:13:26
|
|
Make http_base_test stop leaking an event_base.
|
|
b1c79500
|
2010-04-23T14:42:25
|
|
Make evdns logging threadsafe
The old logging code was littered with places where we stored messages in
static char[] fields. This is fine in a single-threaded program, but if you
ever tried to log evdns messages from two threads at once, you'd hit a race.
This patch also refactors evdns's debug_ntop function into a more useful
evutil_sockaddr_port_format() function, with unit tests.
|
|
39b870b8
|
2010-04-22T21:49:05
|
|
Add dns/search_cancel unit test.
|
|
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)
|
|
10c4c904
|
2010-04-12T12:50:17
|
|
Do not inhibit automake dependencies generation
It fixes make parallel builds.
|
|
1234b95a
|
2010-04-09T17:19:39
|
|
Test another case of evbuffer_prepend
|
|
8c83e995
|
2010-04-09T16:40:53
|
|
Add more unit tests for evbuffer_expand
|
|
06a4443a
|
2010-04-09T15:28:26
|
|
Unit-test every evbuffer_add_file() implementation.
Previously, we'd only test the default one, even if the others were still
compiled in.
|
|
d5ebcf37
|
2010-03-30T16:47:37
|
|
Rewrite evbuffer_expand and its users
The previous evbuffer_expand was not only incorrect; it was
inefficient too. On all questions of time vs memory tradeoffs, it
chose to burn time in order to avoid wasting memory. The new code
tries to be a little more balanced: it only resizes an existing chain
when doing so doesn't require too much copying, and when failing to do
so would waste a lot of the chain's space.
This patch also rewrites evbuffer_chain_insert to work properly with
last_with_datap, and adds a few convenience functions to buffer.c.
|
|
b7442f8e
|
2010-03-26T23:18:40
|
|
Replace last_with_data with a slightly smarter version
To implement evbuffer_expand() properly, you need to be able to
replace the last chunk that has data, which means that we need to keep
track of the the next pointer pointing to the last_with_data chunk,
not the last_with_data chunk itself.
|
|
7960af51
|
2010-03-22T13:37:39
|
|
Merge branch 'build'
|
|
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.
|
|
274a7bd9
|
2010-03-13T00:55:39
|
|
Fix some memory leaks in the unit tests
These don't matter except inasmuch as they give real memory leaks
a place to hide.
Found with valgrind
|
|
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.
|
|
0d047c3f
|
2010-03-13T00:29:15
|
|
Fix an obnoxious typo in the bufferevent_timeout_filter test
We were using the same bufferevent as the child of two filtering parents,
orphaning another. This made one get freed twice, and the other not at all.
Possible fix for bug 2963306 spotted by Doug Cuthbertson.
|
|
b660edf9
|
2010-03-12T13:22:47
|
|
Remove redundant stuff from EXTRA_DIST
To a first approximation, sources that are mentioned anywhere in an
automake file don't need to get mentioned in EXTRA_DIST.
|
|
426c8fbe
|
2010-03-12T13:09:28
|
|
Support the standard 'make check' target in place of 'make verify'
Based on patch 2816088 from Zack Weinberg
|
|
17da042d
|
2010-03-11T15:39:44
|
|
Add some glass-box tests for the last_with_data code.
|
|
6f47bd12
|
2010-03-10T23:28:51
|
|
Remove previous_to_last from evbuffer
|
|
c8ac57f1
|
2010-03-10T23:24:14
|
|
Use last_with_data in place of previous_to_last
This actually makes some of the code a lot simpler. The only
ones that actually used previous_to_last for anything were reserving
and committing space.
|
|
2a6d2a1e
|
2010-03-10T22:16:14
|
|
Revise evbuffer to add last_with_data
This is the first patch in a series to replace previous_to_last with
last_with_data. Currently, we can only use two partially empty chains
at the end of an evbuffer, so if we have one with 511 bytes free, and
another with 512 bytes free, and we try to do a 1024 byte read, we
can't just stick another chain on the end: we need to reallocate the
last one. That's stupid and inefficient.
Instead, this patch adds a last_with_data pointer to eventually
replace previous_to_last. Instead of pointing to the penultimated
chain (if any) as previous_to_last does, last_with_data points to the
last chain that has any data in it, if any. If all chains are empty,
last_with_data points to the first chain. If there are no chains,
last_with_data is NULL.
The next step is to start using last_with_data everywhere that we
currently use previous_to_last. When that's done, we can remove
previous_to_last and the code that maintains it.
|
|
2c2618d8
|
2010-03-05T13:00:15
|
|
more whitespace normalization
|
|
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"
|
|
1273d2f5
|
2010-03-02T15:16:28
|
|
VC has no getopt(), so do without in bench_http.
|
|
4ac38a5c
|
2010-03-02T14:34:30
|
|
Get bench_http to work on Windows; add a switch to enable IOCP.
|
|
7ffd3875
|
2010-02-24T13:40:06
|
|
Delete stack-alloced event in new unit test before returning.
|
|
f3dfe462
|
2010-02-23T23:59:26
|
|
Use new timeval diff comparison function in bufferevent test
|
|
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.
|
|
c02bfe12
|
2010-02-23T16:36:52
|
|
Add a test for timeouts on filtering bufferevents.
|
|
d3288293
|
2010-02-20T18:44:35
|
|
Provide consistent, tested semantics for bufferevent timeouts
The different bufferevent implementations had different behavior for
their timeouts. Some of them kept re-triggering the timeouts
indefinitely; some disabled the event immediately the first time a
timeout triggered. Some of them made the timeouts only count when
the bufferevent was actively trying to read or write; some did not.
The new behavior is modeled after old socket bufferevents, since
they were here first and their behavior is relatively sane.
Basically, each timeout disables the bufferevent's corresponding
read or write operation when it fires. Timeouts are stopped
whenever we suspend writing or reading, and reset whenever we
unsuspend writing or reading. Calling bufferevent_enable resets a
timeout, as does changing the timeout value.
|
|
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.
|
|
8fdf09c0
|
2010-02-18T17:08:50
|
|
Clean up formatting: Disallow space-before-tab.
|
|
b72be50d
|
2010-02-18T13:52:04
|
|
Add some headers to fix freebsd compilation
|
|
48a29b68
|
2010-02-18T01:43:37
|
|
Add a unit test for secure rng.
Mostly, this is just to make sure our arc4random_buf() implementation isn't
dumb.
|
|
ca46d25b
|
2010-02-17T23:02:28
|
|
Merge branch 'arc4random'
|
|
2f782af3
|
2010-02-13T17:04:17
|
|
validate close cb on server when client connection closes
|
|
e8a9782c
|
2010-02-13T16:59:37
|
|
clean up terminate_chunked test
|
|
d4de062e
|
2010-02-10T17:19:18
|
|
Add an arc4random implementation for use by evdns
Previously, evdns was at the mercy of the user for providing a good
entropy source; without one, it would be vulnerable to various
active attacks.
This patch adds a port of OpenBSD's arc4random() calls to Libevent
[port by Chris Davis], and wraps it up a little bit so we can use it
more safely.
|
|
1dd7e6dc
|
2010-02-05T01:16:23
|
|
Remove the 'flags' argument from evdns_base_set_option()
The 'flags' argument made sense when passed to
evdns_(base_)?parse_resolv_conf when it said which parts of the
resolv.conf file to obey. But for evdns_set_option(), it was really
silly, since you wouldn't be calling evdns_set_option() unless you
actually wanted to set the option. Its meaning was basically, "set
this to DNS_OPTIONS_ALL unless you want a funny surprise."
evdns_base_set_option was new in 2.0.1-alpha, so we aren't committed
to keeping it source-compatible.
|
|
a7a94310
|
2010-02-03T23:49:22
|
|
Fix some additional -DUNICODE issues on win32.
Brodie's patch didn't catch the ones that were new since 1.4.
|
|
e2d15d81
|
2010-02-03T17:52:55
|
|
Merge remote branch 'niels/http_chunk'
|
|
93d73691
|
2010-02-03T14:34:56
|
|
do not fail while sending on http connections the client closed.
when sending chunked requests via multiple calls to evhttp_send_reply_chunk,
the client may close the connection before the server is done sending. this
used to cause a crash.
we introduce a new function evhttp_request_get_connection() that allows the
server to determine if the request is still associated with a connection.
If it's not, evhttp_request_free() needs to be called explicitly or the user
can call evhttp_send_reply_end() which just frees the request, too.
|
|
60742d58
|
2010-02-03T17:01:45
|
|
Add the rest of the integer limits, and add a test for them.
|
|
5c7a7bca
|
2010-01-23T20:07:05
|
|
Fix windows and msvc build
|
|
918e9c5e
|
2010-01-23T16:38:36
|
|
Fix a number of warnings from gcc -pedantic
|
|
e2ca403f
|
2010-01-23T16:23:45
|
|
Make it compile under gcc --std=c89.
|
|
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.
|
|
97a8c790
|
2010-01-22T00:34:21
|
|
Fix compilation of rate-limit code when threading support is disabled
|
|
8d4aaf90
|
2010-01-20T12:56:54
|
|
Don't use a bind address for nameservers on loopback
If the user sets a bind address to use for nameservers, and a
nameserver happens to be on 127.0.0.1, the nameserver will generally
fail. This patch alters this behavior so that the bind address is
only applied when the nameserver is on a non-loopback address.
|
|
78a50fe0
|
2010-01-14T17:39:54
|
|
forgot to add void to test function
|
|
26714ca1
|
2010-01-14T17:05:00
|
|
add a test for evhttp_connection_base_new with a dns_base
|
|
b8226390
|
2010-01-14T16:53:25
|
|
move dns utility functions into a separate file so that we can use them for http testing
|
|
a334b31c
|
2010-01-14T14:46:16
|
|
More unit tests for getaddrinfo_async: v4timeout and cancel.
One covers the case where the v4 request times out but the v6 request
doesn't. The other makes sure that cancelling a request actually works.
|
|
94131e92
|
2010-01-12T15:58:36
|
|
Fix test.sh on shells without echo -n
Some systems have a version of /bin/sh whose builtin echo doesn't
support the -n option used in test/test.sh. /bin/echo, however,
usually does. This patch makes us use /bin/echo for echo -n whenever
it is present.
Also, our use of echo -n really only made sense when suppressing all
test output. Since test output isn't suppressed when logging to a
file, this pach makes us stop using echo -n when logging to a file.
|
|
6cc79c6b
|
2010-01-11T19:04:11
|
|
Add unit-test for bad_request bug fixed in 1.4 recently.
This is a partial forward-port from 4fd2dd9d83a000b6. There's no need
to forward-port the bugfix, since the test passes with http.c as-is.
I believe we fixed this while we were porting evhttp to bufferevent.
--nickm
|
|
72dd6667
|
2009-12-07T17:21:41
|
|
evdns_getaddrinfo() now supports the /etc/hosts file.
The regular blocking evutil_getaddrinfo() already supported /etc/hosts
by falling back to getaddrinfo() or gethostbyname(). But
evdns_getaddrinfo() had no such facility. Now it does.
The data structure here isn't very clever. I guess people with huge
/etc/hosts files will either need to get out of the 1980s, or submit a
patch to this code so that it uses a hashtable instead of a linked
list.
Includes basic unit tests.
|
|
ba2945f9
|
2010-01-06T17:59:44
|
|
Merge branch 'ratelimit'
Conflicts:
bufferevent_async.c
|
|
165d30e3
|
2009-12-30T14:29:56
|
|
Fix compilation of rate-limiting code on win32.
|
|
885b4273
|
2009-12-30T13:50:52
|
|
Fix test-ratelim compilation on Linux.
I'd forgotten to include time.h, and to link against libm.
|
|
0b151a9f
|
2009-12-29T18:11:52
|
|
Whitespace fixes in test.sh
|
|
7dfbe94a
|
2009-12-29T18:07:51
|
|
Allow test.sh to be run as ./test/test.sh
|
|
c382de64
|
2009-12-29T17:59:55
|
|
Allow the user to redirect the verbose output of test/test.sh to a file
By default, the test.sh script still suppresses the output of all the
tests it invokes. Now, however, you can have that output written to
a file specified in the TEST_OUTPUT_FILE shell variable.
|
|
1e56a32d
|
2009-12-29T16:04:16
|
|
Make the initial nameserver probe timeout configurable.
When we decide that a nameserver is down, we stop sending queries to
it, except to periodically probe it to see if it has come back up.
Our previous probe sechedule was an ad-hoc and hard-wired "10 seconds,
one minute, 5 minues, 15 minutes, 1 hour, 1 hour, 1 hour...". There
was nothing wrong with having it be ad-hoc, but making it hard-wired
served no good purpose.
Now the user can set the initial timeout via a new
"initial-probe-timeout:" option; future timeouts back off by a factor
of 3 on every failure to a maximum of 1 hour.
As a side-benefit, this lets us cut the runtime of the dns/retry test
from about 40 seconds to about 3 seconds. Faster unit tests are
always a good thing.
|
|
f0c0124e
|
2009-12-23T07:54:13
|
|
Testing code for bufferevent rate-limiting.
This is not part of the regression tests, since running it necessarily
takes a while. There is a new test-ratelim test; run it with '-h'
for an argument to see its options.
|
|
4a5b5343
|
2009-12-23T07:48:43
|
|
Do not ignore bufferevent_enable(EV_READ) before bufferevent_connect().
Previously, we weren't remembering that we wanted to re-add the read
event once the connect was finished. Now we are.
|
|
c51bb3c3
|
2009-12-21T16:36:40
|
|
Fix a few locking issues on windows.
|
|
70cdfe49
|
2009-12-06T02:59:19
|
|
Fix compile on Snow Leopard with gcc warnings enabled
|
|
7ae94450
|
2009-12-04T16:37:43
|
|
Fix a snow leopard compile warning in the unit tests.
Reported by Sebastian Hahn.
|
|
31687b4d
|
2009-12-02T01:22:07
|
|
Fix regress_iocp.c usage of old lock allocation macros.
|
|
d84d8385
|
2009-11-27T15:24:32
|
|
Fix two use-after-free bugs in unit tests spoted by lock debugging
|
|
347952ff
|
2009-11-27T15:20:43
|
|
Revise the locking API: deprecate the old locking callbacks and add trylock.
Previously, there was no good way to request different kinds of lock
(say, read/write vs writeonly or recursive vs nonrecursive), or for a
lock function to signal failure (which would be important for a
trylock mode).
This patch revises the lock API to be a bit more useful. The older
lock calls are still supported for now.
We also add a debugging mode to catch common errors in using the
locking APIs.
|
|
986500de
|
2009-11-19T22:02:33
|
|
nick found a race condition in the pthreads test case
svn:r1554
|