|
cd17c3ac
|
2010-01-22T00:34:37
|
|
Add support for a "debug mode" to try to catch common errors.
Right now it only catches cases where we aren't initializing events,
or where we are re-initializing events without deleting them first.
These are however shockingly common.
|
|
70a4a3ef
|
2010-01-23T16:47:54
|
|
Remove a needless include of rpc_compat.h
Nothing in evrpc.c was using rpc_compat.h, so it's best to take it
out, especially since it polluted our build process with GCC variadic
macros.
While we're at it, this patch puts an extra restriction on when the
variadic macros in rpc_compat.h are defined. Not only must GCC be the
compiler, but GCC must not be running in -ansi mode.
|
|
918e9c5e
|
2010-01-23T16:38:36
|
|
Fix a number of warnings from gcc -pedantic
|
|
ff3f6cd4
|
2010-01-22T16:14:49
|
|
Check more internal event_add() calls for failure
Most of these should be unable to fail, since adding a timeout
generally always works. Still, it's better not to try to be "too
smart for our own good here."
There are some remaining event_add() calls that I didn't add checks
for; I've marked those with "XXXX" comments.
|
|
06839503
|
2010-01-19T14:01:36
|
|
Functions to access more fields of struct event.
Once event_assign() or event_new() had been called, there was no way
to get at a copy of the event's callback, callback argument, or
configured events. This patch adds an accessor function for each, and
an all-fields accessor for code that wants to re-assign one field of
an event.
This patch also adds a function to return sizeof(struct event), so
that code with intense RAM needs can still retain ABI compatibility
between versions of Libevent without having to heap-allocate every
struct event individually.
The code here was first proposed by Pavel Pisa.
|
|
5032e526
|
2010-01-14T15:42:07
|
|
do not use a function to assign the evdns base; instead assign it via evhttp_connection_base_new() which is a new function introduced in 2.0
|
|
c698b77d
|
2009-12-30T00:11:27
|
|
Allow http connections to use evdns for hostname looksups.
This was as simple as using bufferevent_connect_hostname instead of
calling connect() ourself, which already knows how to use an
evdns_base if it gets one.
Untangling the bind code might be a little trickier.
|
|
b9f43b23
|
2010-01-11T20:47:36
|
|
Add a comment on evthread_enable_lock_debuging.
|
|
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
|
|
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.
|
|
d0939d2b
|
2009-12-29T16:21:26
|
|
Introduced evutil_make_socket_closeonexec() to preserve fd flags for F_SETFD.
Use this to eliminate the various macros that called F_SETFD throughout
the code.
|
|
737c9cd8
|
2009-11-27T13:16:54
|
|
Rate-limiting for bufferevents; group and individual limits are supported.
The fairness algorithms are not the best, not every bufferevent type
is supported, and some of the locking tricks here are simply absurd.
Still, this code should be a good first step.
|
|
47854a80
|
2009-12-28T01:40:37
|
|
Expose our cached gettimeofday value with a new interface
I've got a two use case that wants this for a fairly sensible purpose:
one external and on internal.
|
|
390e0561
|
2009-12-22T15:52:02
|
|
Fix up behavior of never-defered callbacks a little
|
|
ea6b1df2
|
2009-12-08T15:38:34
|
|
Only define _GNU_SOURCE if it is not already defined.
|
|
438f9ed2
|
2009-11-23T15:53:24
|
|
Add the abilitity to mark some buffer callbacks as never-deferred.
|
|
bd6f1bab
|
2009-12-02T01:15:15
|
|
Fix up evthread compilation on windows
|
|
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.
|
|
07e9e9b4
|
2009-11-20T16:50:55
|
|
Parenthesize macro arguments more aggressively
|
|
f32b5750
|
2009-11-20T16:38:01
|
|
Add a warning about the use of event_initialized.
|
|
f1691539
|
2009-11-19T23:08:50
|
|
Remove most calls to event_err() in http and deal with memory errors instead
svn:r1555
|
|
201d8d0b
|
2009-11-17T18:29:44
|
|
Clarify even more about various system-specific problems with getaddrinfo
svn:r1542
|
|
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
|
|
ab96b5f3
|
2009-11-09T18:30:33
|
|
Add an option to disable the timeval cache.
svn:r1518
|
|
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
|
|
25a5e681
|
2009-11-05T20:37:19
|
|
Build fixes for MSVC
svn:r1506
|
|
d14c3b45
|
2009-11-05T18:25:46
|
|
Fix another ssize_t user
svn:r1503
|
|
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
|
|
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
|
|
e90e14fb
|
2009-11-02T16:31:13
|
|
Call the bufferevent_flush_mode variable "mode" more consistently in the documentation. Spotted by Alex.
svn:r1485
|
|
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
|
|
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
|
|
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
|
|
879420a7
|
2009-10-23T22:00:29
|
|
Expose a narrow window to the IOCP code.
svn:r1459
|
|
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
|
|
e1c9b84a
|
2009-10-19T16:20:12
|
|
Fix compilation for listener.h for C++ - missing extern "C". Patch from Ferenc Szalai.
svn:r1448
|
|
e3fd294a
|
2009-10-16T13:19:57
|
|
Spelling fixes in comments and strings.
svn:r1445
|
|
e6b747c3
|
2009-10-12T21:06:30
|
|
Declare struct timezone in util.h so that borken mingw versions do not complain
svn:r1441
|
|
d5b640fc
|
2009-10-01T15:29:08
|
|
Apply Ka-Hing Cheung's event_base_got_[break|exit] patch, with locking and whitespace fixes.
svn:r1438
|
|
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
|
|
f2282398
|
2009-08-14T20:07:35
|
|
New function to put an SSL bufferevent into a renegotiating state.
svn:r1418
|
|
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
|
|
d4134772
|
2009-07-31T17:35:42
|
|
Refactor evbuffer_readln() into a search-for-eol function and an extract-line function.
svn:r1404
|
|
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
|
|
eecefc50
|
2009-07-30T20:41:00
|
|
Add a function to extract the SSL object from a bufferevent_openssl.
svn:r1395
|
|
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
|
|
72ea534f
|
2009-07-28T19:41:57
|
|
Export evutil_str[n]casecmp as evutil_ascii_str[n]casecmp.
svn:r1387
|
|
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
|
|
670658eb
|
2009-07-21T18:32:57
|
|
Correct the signatures for evdns_configure_windows_nameservers(), now that it is exposed.
svn:r1369
|
|
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
|
|
1fb2e818
|
2009-07-17T21:47:45
|
|
Use a uniform strategy when a function is not working: do not expose
it.
Rather than failing at runtime, it is better to fail at compile or
link time.
svn:r1363
|
|
d3bef1a1
|
2009-07-17T20:32:25
|
|
Finish implementing new convention that whenever an optional function is declared, a corresponding macro is defined.
svn:r1361
|
|
a386fde3
|
2009-07-17T20:28:03
|
|
Checking for MS_WINDOWS rather than WIN32 is a Tor-ism. Fix that!
svn:r1360
|
|
ed038295
|
2009-07-17T20:22:48
|
|
Define a macro to indicate that we have defined one of the optional evthread_use macros
svn:r1355
|
|
5d71b25b
|
2009-07-17T18:38:38
|
|
Remove all trailing whitespace from end-of-line.
svn:r1350
|
|
eb97bb76
|
2009-05-28T15:58:28
|
|
Make the headers compile happily with pedantic C compilers.
Original message from SF patch 2797966:
While commas at the end of enumerator lists are valid in c99, they
are not valid +in c89 nor in c++. When using gcc/g++ with the
-pedantic flag, users will +receive a warning (gcc) or an
error(g++) when including the event2/event.h and
+event2/bufferevent.h. The errors look something like
event2/event.h:159: error: comma at end of enumerator list
Patch from Akita Noek on Sourceforge.
svn:r1321
|
|
0b4ab122
|
2009-05-28T15:47:15
|
|
Spell-check the the headers
svn:r1320
|
|
3f0e4928
|
2009-05-27T23:48:59
|
|
small doc fix.
svn:r1319
|
|
5232cfa3
|
2009-05-25T23:11:20
|
|
Consistently say "eventcb" instead of "errorcb"
svn:r1316
|
|
0b22ca19
|
2009-05-22T19:11:48
|
|
Use ev_ssize_t in place of ssize_t *everywhere*.
svn:r1309
|
|
8997f234
|
2009-05-21T20:59:00
|
|
Use the native "struct iovec" as our "struct evbuffer_iovec" when available, so we do not need to copy more pointers than necessary.
svn:r1299
|
|
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
|
|
b4886ec8
|
2009-05-15T18:44:44
|
|
Trim 22 bytes from struct event on 32 bit platforms, more on 64-bit platforms.
svn:r1292
|
|
27fef1ef
|
2009-05-14T18:06:41
|
|
Note problems with some newer evbuffer interfaces.
svn:r1286
|
|
3e759a01
|
2009-05-14T18:06:29
|
|
Actually, do not provide a compatibility name "EVBUFFER_CONNECTED": there is no old code that uses it.
svn:r1285
|
|
31d89f27
|
2009-05-13T20:37:21
|
|
Add a "ctrl" mechanism to bufferevents for property access.
OpenSSL uses something like this to implement get/set access for
properties on its BIOs, so that it doesn't need to add a pair of
get/set functions to the vtable struct for every new abstract property
it provides an accessor for.
Doing this lets us make bufferevent_setfd abstract, and implement an
abstract bufferevent_getfd.
svn:r1284
|
|
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
|
|
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
|
|
0fd70978
|
2009-05-05T01:09:03
|
|
Add an event_get_base() function to remove one more reason to include event_struct.h
svn:r1271
|
|
d5ca0763
|
2009-05-02T16:23:29
|
|
Move event_set() and friends to event2/event_compat.h.
These functions are deprecated in favor of event_assign().
svn:r1267
|
|
b2e8fd0e
|
2009-04-30T23:56:53
|
|
Apparently MSVC lacks a ssize_t. Define an ev_ssize_t for headers, and make ssize_t work elsewhere.
svn:r1261
|
|
19594141
|
2009-04-29T20:48:21
|
|
Clarify semantics on event_pending()
svn:r1249
|
|
a146af1d
|
2009-04-25T00:15:55
|
|
move more code directly into evrpc.c; provide backwards compatible vararg macros
svn:r1244
|
|
b228ff91
|
2009-04-25T00:15:31
|
|
remove vararg macros for accessing evrpc structs
svn:r1243
|
|
bbf79707
|
2009-04-25T00:14:58
|
|
refactor evrpc.h header filer
svn:r1241
|
|
11ff74cf
|
2009-04-22T19:41:23
|
|
Add a flag to disable checking the EVENT_* environment variables.
svn:r1220
|
|
ea8cc76c
|
2009-04-21T18:47:23
|
|
Fix the documentation of event_pending.
svn:r1215
|
|
eda27f95
|
2009-04-19T20:54:12
|
|
Update copyright notices, add some missing license statements
svn:r1208
|
|
f00f0c25
|
2009-04-18T04:34:45
|
|
make doxygen happier
svn:r1199
|
|
a98a512b
|
2009-04-17T23:12:34
|
|
Add a generic way for any bufferevent to make its callback deferred
svn:r1197
|
|
d047b323
|
2009-04-17T17:22:32
|
|
Increment version to 2.0.1-alpha, and add a numeric version facility
svn:r1193
|
|
49354138
|
2009-04-17T06:57:13
|
|
Oh hey. There is no support for suspend/unsuspend.
svn:r1187
|
|
7fa8451d
|
2009-04-17T06:56:57
|
|
Add a configure flag to hardcode all of our mm functions.
svn:r1186
|
|
a8f6d961
|
2009-04-17T06:56:09
|
|
Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h
svn:r1183
|
|
796ba15f
|
2009-04-17T06:55:25
|
|
Stop claiming that APIs we have are missing.
svn:r1182
|
|
838d0a81
|
2009-04-17T06:55:08
|
|
Document many internal functions and pieces of code.
svn:r1181
|
|
30648529
|
2009-04-17T01:03:07
|
|
have evhttp_set_cb return an int; -1 on failure, 0 on success; this is better than returning a pointer
svn:r1179
|
|
93d4f884
|
2009-04-14T20:11:10
|
|
Make buffer iocp stuff compile happily
svn:r1174
|