|
e794d716
|
2009-11-02T20:20:40
|
|
Clean up acceptex code some more: add locking, single-threading, enable/disable.
svn:r1491
|
|
a84c87d7
|
2009-11-02T19:51:26
|
|
Refactor IOCP callback interface
Chris Davis points out that GetQueuedCompletionStatus
sometimes returns false not to report "No events for
you!" but instead to report "An overlapped operation
failed." Add a way to tell an event_overlapped that
its operation failed.
svn:r1490
|
|
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
|
|
5d2c1650
|
2009-11-02T17:42:09
|
|
More refactoring for IOCP listener code
svn:r1486
|
|
e90e14fb
|
2009-11-02T16:31:13
|
|
Call the bufferevent_flush_mode variable "mode" more consistently in the documentation. Spotted by Alex.
svn:r1485
|
|
7f0ad2f6
|
2009-11-02T16:17:06
|
|
Fix an errant user of ssize_t to use ev_ssize_t.
My usual strategy of grep '[^_]ssize_t' had apparently failed me,
since this ssize_t was in the first column.
Resolves bug 2890434; spotted by Mihai Draghicioiu.
svn:r1484
|
|
315fde1a
|
2009-10-30T22:43:53
|
|
Remove some duplicate code in kqueue.c and fix a small memory leak.
svn:r1483
|
|
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
|
|
516452b7
|
2009-10-30T21:08:29
|
|
Keep openssl errors associated with the right bufferevent object.
OpenSSL has a per-thread error stack, and really doesn't like you
leaving errors on the stack. Rather than discard the errors or force
the user to handle them, this patch pulls them off the openssl stack
and puts them on a stack associated with the bufferevent_openssl. If
the user leaves them on the stack then, it won't affect any other
connections.
This bug was found by Roman Puls. Thanks!
svn:r1481
|
|
20f5bdfd
|
2009-10-29T19:25:33
|
|
Refactor evconnlistener to allow multiple implementations; add an (incomplete, not-yet-integrated) IOCP implementation.
svn:r1480
|
|
fa313f28
|
2009-10-29T18:30:43
|
|
Extract XP-only functions when initializing the IOCP port
svn:r1479
|
|
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
|
|
1eadb3e3
|
2009-10-29T16:35:15
|
|
Actually use the logic in select.c designed to make the out_sets threadsafe.
svn:r1475
|
|
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
|
|
a2a7d1d1
|
2009-10-27T05:16:32
|
|
Do not call the locking variant of event_add or event_active in some cases when we know we have the lock.
svn:r1471
|
|
d386dc89
|
2009-10-27T05:16:23
|
|
Refactor event_assing even more to avoid unnecessary calls
svn:r1470
|
|
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
|
|
10cf631e
|
2009-10-27T04:04:07
|
|
Do not add a newline to the end of log statements.
svn:r1468
|
|
369aafc4
|
2009-10-27T04:03:58
|
|
Refactor kq_init error handling.
svn:r1467
|
|
ed0e91e0
|
2009-10-27T04:03:50
|
|
New test flag to suppress logging for one test.
svn:r1466
|
|
7f10fac3
|
2009-10-26T20:07:06
|
|
Note assert-related change in changelog
svn:r1465
|
|
2e36dbe1
|
2009-10-26T20:00:43
|
|
Use EVUTIL_ASSERT() consistently instead of assert.
svn:r1464
|
|
37c3456d
|
2009-10-26T20:00:08
|
|
Add an EVUTIL_ASSERT() to replace our calls to assert().
The big difference here is that EVUTIL_ASSERT() passes its message on
via event_errx() before aborting, so that the application has a prayer
of noticing and recording it.
svn:r1463
|
|
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
|
|
c119e4a1
|
2009-10-23T17:40:00
|
|
Improve the behavior of le-proxy in a few cases.
svn:r1458
|
|
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
|
|
b73ad7bc
|
2009-10-21T18:48:22
|
|
Treat the bitwise OR of two enum values as an int.
This makes our interfaces usable from C++, which doesn't believe
you can say "bufferevent_socket_nase(base, -1,
BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS)" but which instead
would demand "static_cast<bufferevent_options>(BEV_OPT_CLOSE_ON_FREE|
BEV_OPT_DEFER_CALLBACKS))" for the last argument.
Diagnosis and patch from Chris Davis.
svn:r1456
|
|
4fbac2a5
|
2009-10-21T07:00:19
|
|
Test failing case of bufferevent_connect().
Code by Chris Davis.
svn:r1455
|
|
d8164d0c
|
2009-10-21T07:00:14
|
|
Fix win32 connect() event handling.
Christopher Davis reported:
Connection failures aren't reported on Windows when
using bufferevent_socket_connect, because Windows uses
select's exceptfds to notify of failure, and libevent
treats them like read events. Only the write event
handler is currently used to handle connection events.
We should think hard about this one, since it changes
behavior from 1.4.x. Anything that worked on Mac/Unix before
will work more consistently on Windows now... but this might
break stuff that worked only on Windows, but nowhere else.
Patch from Chris Davis.
svn:r1454
|
|
b89b58b5
|
2009-10-21T06:03:00
|
|
OSX compilation issues
svn:r1453
|
|
c9c4ec26
|
2009-10-21T05:36:27
|
|
Remove an EVBASE_RELEASE_LOCK that I missed.
svn:r1452
|
|
ed748a48
|
2009-10-21T04:45:59
|
|
Fix win32 compilation.
svn:r1451
|
|
6b22e74a
|
2009-10-21T03:54:00
|
|
Add locking to event_base_loop.
This is harder than it sounds, since we need to make sure to
release the lock around the key call to the kernel (e.g.,
select, epoll_wait, kevent), AND we need to make sure that
none of the fields that are used in that call are touched by
anything that might be running concurrently in another
thread. I managed to do this pretty well for everything but
poll(). With poll, I needed to introduce a copy of the
event_set structure.
This patch also fixes a bug in win32.c where we called
realloc() instead of mm_realloc().
svn:r1450
|
|
50825466
|
2009-10-21T02:14:16
|
|
Fix windows compilation warnings.
svn:r1449
|
|
e1c9b84a
|
2009-10-19T16:20:12
|
|
Fix compilation for listener.h for C++ - missing extern "C". Patch from Ferenc Szalai.
svn:r1448
|
|
b812563a
|
2009-10-16T13:20:16
|
|
Add a note that we should change previous_to_last to last_with_space
svn:r1447
|
|
f3dee9e8
|
2009-10-16T13:20:09
|
|
Correct the signatures for the evmap_io_* functions to use evutil_socket_t.
svn:r1446
|
|
e3fd294a
|
2009-10-16T13:19:57
|
|
Spelling fixes in comments and strings.
svn:r1445
|
|
25af6954
|
2009-10-14T00:46:47
|
|
When a bufferevent_connect() call fails, give the client an error callback.
Patch from Christopher Davis.
svn:r1444
|
|
fc83ca3c
|
2009-10-14T00:46:40
|
|
Fix some crash bugs when initializing evdns
svn:r1443
|
|
e6b747c3
|
2009-10-12T21:06:30
|
|
Declare struct timezone in util.h so that borken mingw versions do not complain
svn:r1441
|
|
633f3fb7
|
2009-10-02T03:07:29
|
|
Add changelog for last commit
svn:r1440
|
|
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
|
|
d5b640fc
|
2009-10-01T15:29:08
|
|
Apply Ka-Hing Cheung's event_base_got_[break|exit] patch, with locking and whitespace fixes.
svn:r1438
|
|
8e8d94a3
|
2009-09-24T22:18:19
|
|
Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
svn:r1436
|
|
18fe4008
|
2009-09-23T23:51:26
|
|
Forward-port: fix android compilation
svn:r1435
|
|
2622e5ac
|
2009-09-16T17:17:57
|
|
Fix the assert I added to epoll.c: spotted by Dmitry Novikov
svn:r1432
|
|
c2ead9f1
|
2009-09-11T21:02:19
|
|
Treat events with fd == -1 as addable.
This turns out to simplify a fair bit of logic, including the bufferevent
code, and should fix bug 2850656.
svn:r1431
|
|
85255a63
|
2009-09-11T18:47:35
|
|
Make epoll use less RAM.
We do this by not allocating the maximum epoll_event array for the epoll
backend at startup. Instead, we start out accepting 32 events at a time, and
double the array's size when it seems that the OS is generating events faster
than we're requesting them. This saves up to 374K per epoll-based
event_base. Resolves bug 2839240.
svn:r1428
|
|
e3f89fa2
|
2009-09-11T18:21:57
|
|
Add a trivial race-fix from Chromium: do not try to re-detect whether we have a monotonic clock every time we make a new event_base.
svn:r1427
|
|
3b461a6d
|
2009-09-11T18:21:37
|
|
Treat a negative number of bytes to read as the kernel saying "I don't know."
svn:r1426
|
|
f65b8b09
|
2009-08-19T20:55:25
|
|
On connect, call only one of BEV_EVENT_CONNECTED or writecb.
Previously, if we had a socket bufferevent in connect state, we'd send
both of these to indicate that the connection was done. That was broken
since the point of adding BEV_EVENT_CONNECTED was so that we could
distinguish "we're connected" and "we wrote something".
Now, writecb is called only when
A) the connection finished but the user never put the socket into a
"connecting" state, or
B) data was actually written.
svn:r1425
|
|
2c1b0e44
|
2009-08-16T19:22:15
|
|
Fix build warnings and add changelog entry for evhttp patches.
svn:r1424
|
|
c8b0fe4a
|
2009-08-16T19:22:10
|
|
Define evhttp_del_accept_socket
[Patch from David Reiss]
svn:r1423
|
|
6c53334c
|
2009-08-16T19:22:04
|
|
Define evhttp_{bind,accept}_socket_with_handle
[Patch from David Reiss]
svn:r1422
|
|
4bcd5646
|
2009-08-16T19:21:57
|
|
Make evhttp_bound_socket visible, and provide an accessor to its fd
Declare the previously private struct evhttp_bound_socket in
event2/http.h as an opaque struct.
Implement evhttp_bound_socket_get_fd, which returns the file descriptor
of an evhttp_bound_socket.
[Patch from David Reiss]
svn:r1421
|
|
0755833e
|
2009-08-16T19:21:50
|
|
Minor documentation fixes
[Patch from David Reiss]
svn:r1420
|
|
22bd5b42
|
2009-08-16T16:40:42
|
|
Support sendfile on solaris: patch from Caitlin Mercer.
svn:r1419
|
|
f2282398
|
2009-08-14T20:07:35
|
|
New function to put an SSL bufferevent into a renegotiating state.
svn:r1418
|
|
46a61869
|
2009-08-14T20:07:17
|
|
Disable whichever struct event we don't want during ssl handshaking.
svn:r1417
|
|
58b0708e
|
2009-08-14T20:07:09
|
|
Only send a connected event _after_ we've adjusted the SSL state.
This is important if the callback adjusts it to something else.
svn:r1416
|
|
d17c720c
|
2009-08-14T20:07:01
|
|
Remove an extraneous puts().
svn:r1415
|
|
eff09a29
|
2009-08-14T20:06:48
|
|
tab/whitespace fixes in bufferevent_sock.c
Also note that write() doesn't usually say 0.
svn:r1414
|
|
bd26bace
|
2009-08-11T19:47:46
|
|
When running with deferred callbacks, always send the "connected" event
before any read/write events, and send timeout/error/eof events after.
svn:r1413
|
|
7a55c48d
|
2009-08-09T20:18:00
|
|
Add a few missing changelog entries
svn:r1412
|
|
800f9aa6
|
2009-08-09T20:17:29
|
|
When bufferevent_socket_connect is called with no address, assume that our existing fd is connecting and put the connection into "connecting" mode.
svn:r1411
|
|
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
|
|
d4134772
|
2009-07-31T17:35:42
|
|
Refactor evbuffer_readln() into a search-for-eol function and an extract-line function.
svn:r1404
|
|
a26d2d1b
|
2009-07-31T17:34:47
|
|
Refactor evbuffer_readln to use evbuffer_ptr; remove old evbuffer_iterator.
svn:r1403
|
|
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
|
|
621aafd2
|
2009-07-30T22:11:23
|
|
Export sockaddr comparison functionality.
svn:r1400
|
|
cf54d74a
|
2009-07-30T20:41:41
|
|
More unit tests for Openssl, including initializing with no socket. Up to 75% coverage.
svn:r1399
|
|
d1a2254b
|
2009-07-30T20:41:31
|
|
Fix some bugs in bufferevent_socket_connect
svn:r1398
|
|
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
|
|
595f7e38
|
2009-07-30T20:41:12
|
|
Always retry SSL_write() with the same number you told it last time.
svn:r1396
|
|
eecefc50
|
2009-07-30T20:41:00
|
|
Add a function to extract the SSL object from a bufferevent_openssl.
svn:r1395
|
|
d5a3f1f1
|
2009-07-30T20:40:50
|
|
Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag, and explain why.
svn:r1394
|
|
44715517
|
2009-07-30T20:40:40
|
|
Use SSL_do_handshake in place of SSL_connect/SSL_accept
svn:r1393
|
|
8a3007ef
|
2009-07-30T17:01:38
|
|
More evconnlistener unit tests: bump its coverage from 71% to 83%.
svn:r1392
|
|
7c20a6ae
|
2009-07-30T17:01:21
|
|
Export an ev_socklen_t.
svn:r1391
|
|
75fe762e
|
2009-07-30T17:00:56
|
|
Accessor function to get a listener's associated fd
svn:r1390
|
|
62511629
|
2009-07-30T17:00:46
|
|
Add unit test for parsing addresses with bad ports.
svn:r1389
|
|
3c99c79d
|
2009-07-28T19:45:54
|
|
Changelog entry for msvc fixes.
svn:r1388
|
|
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
|