|
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
|
|
7511b6a9
|
2009-11-19T00:21:38
|
|
Fix a spelling error and remove some dead code
svn:r1551
|
|
07ce7f99
|
2009-11-18T21:17:00
|
|
Make our failing-connection bufferevent test more tolerant.
I thought we had a way to do connect() that would never fail
immediately, but always wait for a moment before failing. It
turns out that on FreeBSD it can fail immediately. This is not
FreeBSD's fault, or even a real bug anywhere but in the unit test.
svn:r1549
|
|
9bf124bf
|
2009-11-18T21:16:47
|
|
Build correctly with mm replacement turned off.
svn:r1547
|
|
d7d1f1da
|
2009-11-17T20:31:09
|
|
Move responsibility for IOCP callback into bufferevent_async.
This patch from Chris Davis saves some callback depth, and adds proper
ref-counting to bufferevents when there's a deferred evbuffer callback
inflight. It could use a couple more comments to really nail down what
its invariants are.
svn:r1543
|
|
625a261a
|
2009-11-17T02:40:14
|
|
OpenBSD demands that sys/types.h be included before sys/socket.h
svn:r1539
|
|
888007f9
|
2009-11-17T02:38:19
|
|
Windows *does* have getservbyname, no matter what autoconf says.
TODO: figure out why autoconf is confused about this.
svn:r1538
|
|
86f57420
|
2009-11-16T22:25:46
|
|
Add two implementations of getaddrinfo: one blocking and one nonblocking.
The entry points are evutil_getaddrinfo and evdns_getaddrinfo respectively.
There are fairly extensive unit tests.
I believe this code conforms to RFC3493 pretty closely, but there are
probably more issues. It should get tested on more platforms.
This code means we can dump the well-intentioned but weirdly-implemented
bufferevent_evdns and evutil_resolve code.
svn:r1537
|
|
72bafc17
|
2009-11-16T22:23:55
|
|
Remove the stupid brokenness where DNS option names needed to end with a
colon.
svn:r1536
|
|
c79a45e0
|
2009-11-14T21:54:30
|
|
Fix a couple of event_debug calls.
svn:r1527
|
|
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
|
|
ac633aeb
|
2009-11-05T21:22:23
|
|
Fix some build warnings on MSVC, mostly related to signed/unsigned comparisons.
svn:r1510
|
|
4ca9efea
|
2009-11-05T20:40:11
|
|
Add nmake files to build with MSVC.
Right now, they just make static libraries and unit tests. They probably set lots of options wrong.
svn:r1507
|
|
25a5e681
|
2009-11-05T20:37:19
|
|
Build fixes for MSVC
svn:r1506
|
|
47bad8ab
|
2009-11-04T20:17:32
|
|
Implement size limits on HTTP header length and body length.
Patch from Constantine Verutin, simplified a little.
svn:r1500
|
|
86db1c85
|
2009-11-04T05:19:26
|
|
Commit ConnectEx code to get connect working with async bufferevents.
This is code by Chris Davis, with changes to get the unit tests failing less aggressively.
The unit tests for this code do not completely pass yet; Chris is looking into that. If they aren't passing by the next release, I'll turn off this code.
svn:r1499
|
|
0b9eb1bf
|
2009-11-03T20:40:48
|
|
Add a bufferevent function to resolve a name then connect to it.
This function, bufferevent_socket_connect_hostname() can either use
evdns to do the resolve, or use a new function (evutil_resolve) that
uses getaddrinfo or gethostbyname, like http.c does now.
This function is meant to eventually replace the hostname resolution mess in
http.c.
svn:r1496
|
|
fcc7668c
|
2009-11-03T20:05:06
|
|
Fix one IOCP-callback signature I missed
svn:r1495
|
|
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
|
|
0aa6f513
|
2009-11-02T20:59:13
|
|
Fix remaining AcceptEx issues.
svn:r1492
|
|
e794d716
|
2009-11-02T20:20:40
|
|
Clean up acceptex code some more: add locking, single-threading, enable/disable.
svn:r1491
|
|
9a772148
|
2009-11-02T19:31:29
|
|
Compilation and correctness fixes for IOCP listener code.
svn:r1489
|
|
8283b2f0
|
2009-11-02T19:30:25
|
|
Fix a major parenthesis bug in EVUTIL_UPCAST.
Fortunately, this didn't hurt anything previously, since we had no actual users of the macro where the offset of the base type wasn't 0.
svn:r1488
|
|
5f1d6e64
|
2009-11-02T17:42:16
|
|
Add more IOCP tests. They might not pass yet.
svn:r1487
|
|
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
|
|
9976f1e7
|
2009-10-29T17:11:12
|
|
reformat weird indentation in dns tests
svn:r1478
|
|
3c2198cb
|
2009-10-29T17:10:36
|
|
Unit test for reverse ipv6 lookup
svn:r1477
|
|
5b3fb5bf
|
2009-10-29T16:35:20
|
|
More documentation and unit tests for event_tagging.
svn:r1476
|
|
c70c2593
|
2009-10-29T16:35:09
|
|
Unit test for strlcpy
svn:r1474
|
|
e9098203
|
2009-10-27T18:25:19
|
|
Fix from Chris Davis: get error-logging to be happy on win32.
svn:r1473
|
|
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
|
|
ed0e91e0
|
2009-10-27T04:03:50
|
|
New test flag to suppress logging for one test.
svn:r1466
|
|
a8267663
|
2009-10-26T19:59:51
|
|
API to replace all calls to exit() with a user-supplied fatal-error handler.
Also, add unit tests for logging.
svn:r1462
|
|
38aec9ec
|
2009-10-23T22:38:35
|
|
Tweaks to IOCP interface.
svn:r1461
|
|
7b107249
|
2009-10-23T22:07:05
|
|
Fix my fix for the bufferevent_connect_fail() test.
svn:r1460
|
|
879420a7
|
2009-10-23T22:00:29
|
|
Expose a narrow window to the IOCP code.
svn:r1459
|
|
fdd11c00
|
2009-10-21T19:21:05
|
|
Make the bufferevent_connect_fail test faster on OSX.
It seems that connecting to a listener that is bound but not accepting
or listening doesn't give a 'connection refused' error on OSX, but
rather makes the connect() time out after 75 seconds. I couldn't find
any way to make the timout shorter. Fortunately, closing the listener
after a second or so makes the desired error occur after another
second or so.
svn:r1457
|
|
4fbac2a5
|
2009-10-21T07:00:19
|
|
Test failing case of bufferevent_connect().
Code by Chris Davis.
svn:r1455
|
|
50825466
|
2009-10-21T02:14:16
|
|
Fix windows compilation warnings.
svn:r1449
|
|
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
|
|
8e8d94a3
|
2009-09-24T22:18:19
|
|
Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
svn:r1436
|
|
d17c720c
|
2009-08-14T20:07:01
|
|
Remove an extraneous puts().
svn:r1415
|
|
8a99083f
|
2009-08-07T17:16:52
|
|
Add an evbuffer_search_range() to search a bounded range of a buffer
This can be handy when you have one search to find the end of a header
section, and then you want to find a substring within the header
section without looking at the body.
svn:r1410
|
|
0c09fe5a
|
2009-08-03T20:50:56
|
|
Add a couple more evdns tests. Libevent is now, for me, at 80.02% coverage.
svn:r1409
|
|
94e8f9b9
|
2009-08-03T20:15:45
|
|
Another DNS unit tests, to handle reissues.
The evdns module is now up to ~72% coverage; Libevent is up to nearly 80%.
svn:r1408
|
|
dc1f5b1e
|
2009-08-03T20:15:39
|
|
why say fprintf(stdout, X) when you can say printf?
svn:r1407
|
|
213dc2a2
|
2009-08-03T20:15:32
|
|
Fix an annoying evdns crash bug, and add more unit tests for evdns.
svn:r1406
|
|
a5006d80
|
2009-08-03T16:15:57
|
|
Unit tests for DNS search.
svn:r1405
|
|
6dc488bd
|
2009-07-31T17:34:18
|
|
Improved coverage for evbuffer_readln()
svn:r1402
|
|
7c688dd9
|
2009-07-31T14:41:45
|
|
New function to expose bufferevent.enabled
svn:r1401
|
|
cf54d74a
|
2009-07-30T20:41:41
|
|
More unit tests for Openssl, including initializing with no socket. Up to 75% coverage.
svn:r1399
|
|
7a2a51a3
|
2009-07-30T20:41:21
|
|
Add unit tests for SSL session renegotiation.
This tickles the write-blocked-on-read code, and in this case turned
up a bug in it.
svn:r1397
|
|
eecefc50
|
2009-07-30T20:41:00
|
|
Add a function to extract the SSL object from a bufferevent_openssl.
svn:r1395
|
|
8a3007ef
|
2009-07-30T17:01:38
|
|
More evconnlistener unit tests: bump its coverage from 71% to 83%.
svn:r1392
|
|
62511629
|
2009-07-30T17:00:46
|
|
Add unit test for parsing addresses with bad ports.
svn:r1389
|
|
72ea534f
|
2009-07-28T19:41:57
|
|
Export evutil_str[n]casecmp as evutil_ascii_str[n]casecmp.
svn:r1387
|
|
a826a758
|
2009-07-28T19:41:48
|
|
Some tweaks to Brodie Thesfield's MSVC patch.
svn:r1386
|
|
5b5b880b
|
2009-07-28T19:41:39
|
|
Various MSVC cleanups from Brodie Thiesfield.
svn:r1385
|
|
709c21c4
|
2009-07-28T04:03:57
|
|
Bufferevent support for openssl.
This code adds a new Bufferevent type that is only compiled when the
openssl library is present. It supports using an SSL object and an
event alert mechanism, which can either be an fd or an underlying
bufferevent.
There is still more work to do: the unit tests are incomplete, and we
need to support flush and shutdown much better. Sometimes events are
generated needlessly: this will hose performance.
There's a new encrypting proxy in sample/le-proxy.c.
This code has only been tested on OSX, and nowhere else.
svn:r1382
|
|
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
|
|
dc031990
|
2009-07-20T14:55:07
|
|
Add strcasecmp tests to improve evutil coverage a bit
svn:r1364
|
|
9cf4ee7e
|
2009-07-17T21:47:35
|
|
Fix a simple warning
svn:r1362
|
|
c02b305a
|
2009-07-17T20:23:12
|
|
Trivial tests to exercise deferred and locking bufferevent code.
These are done as variations of test_bufferevent_connect, since that
one exercises event callbacks as well as read/write callbacks.
The coverage for bufferevent.c is now up to about 87%, from about 70%.
svn:r1358
|
|
61f2a45d
|
2009-07-17T20:23:05
|
|
Add a tinytest flag to initialize threading.
svn:r1357
|
|
4ba6eda4
|
2009-07-17T20:22:56
|
|
Make evthread_use_pthreads() actually return 0 on success.
svn:r1356
|
|
9c2ecba7
|
2009-07-17T18:42:12
|
|
Oops. -1 is an integer, not a pointer.
svn:r1352
|
|
d6f2e199
|
2009-07-17T18:38:46
|
|
Unit tests for bufferevent_get(fd|_underlying)
svn:r1351
|
|
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
|
|
043515bc
|
2009-07-14T18:50:06
|
|
Stop using C++ style comments.
svn:r1343
|
|
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
|
|
d866f055
|
2009-07-13T20:03:00
|
|
Patch from Zack Weinberg: normalize perror() tt functions and add tt_fail/tt_abort_printf
svn:r1340
|
|
6469598e
|
2009-07-03T17:43:26
|
|
Allow C identifiers as struct names; allow multiple comments in .rpc files; from Zack Weinberg; plus a tiny tweak
svn:r1336
|
|
bbd14de0
|
2009-06-11T17:55:08
|
|
Add sometimes-needed header to regress_bufferevent.c
svn:r1325
|
|
d1ffba1d
|
2009-06-05T19:52:13
|
|
Replace some read/write instances with send/recv to work properly on win32.
svn:r1324
|
|
0b22ca19
|
2009-05-22T19:11:48
|
|
Use ev_ssize_t in place of ssize_t *everywhere*.
svn:r1309
|
|
23243b8a
|
2009-05-19T21:39:35
|
|
Replace reserve/commit with new iovec-based interface. Add a new evbuffer_peek.
svn:r1296
|
|
ed1bbc7a
|
2009-05-18T16:15:56
|
|
Tweak the evconnlistener interface a little.
svn:r1295
|
|
dc4c7b95
|
2009-05-15T22:44:18
|
|
Change the interface of evbuffer_add_reference: give the cleanup function more info.
svn:r1294
|
|
bba69e03
|
2009-05-15T20:23:59
|
|
New semantics for evbuffer_cb_set_flags().
Previously, set_flags() would replace all previous user-visible flags.
Now it just sets the flags, and there is a clear_flags() function to
clear other flags.
svn:r1293
|
|
83f46e51
|
2009-05-13T20:36:56
|
|
Do not use the "evbuffer_" prefix to denote parts of bufferevents.
This is a bit of an interface doozy, but it's really needed in order
to be able to document this stuff without apologizing it. This patch
does the following renamings:
evbuffercb -> bufferevent_data_cb
everrorcb -> bufferevent_event_cb
EVBUFFER_(READ,WRITE,...) -> BEV_EVENT_(...)
EVBUFFER_(INPUT,OUTPUT) -> bufferevent_get_(input,output)
All the old names are available in event2/bufferevent_compat.h
svn:r1283
|
|
89109010
|
2009-05-06T02:34:10
|
|
Addition to bufferevent_async unit test
svn:r1279
|
|
fe47003d
|
2009-05-05T16:52:37
|
|
Make unit tests for bufferevent_async compile and _almost_ work.
Either I need to make the callbacks get deferred in a base with no events (doable), or I need to make it okay to call launch_read from inside the callback for read (tricky).
svn:r1277
|
|
02801e5b
|
2009-05-05T15:36:28
|
|
Add a trival start of a be_async test.
svn:r1276
|
|
659d54d5
|
2009-05-05T02:59:26
|
|
Add new code to make and accept connections.
This is stuff that it's easy to get wrong (as I noticed when writing
bench_http), and that takes up a fair amount of space (see http.c).
Also, it's something that we'll eventually want to abstract to use
IOCP, where available.
svn:r1272
|
|
bd73ed48
|
2009-05-02T16:24:23
|
|
Revise regress_pthreads.c to not use event_set
svn:r1269
|