|
e5bbd40a
|
2010-02-18T17:41:15
|
|
Clean up formatting: use tabs, not 8-spaces, to indent.
|
|
a19b4a05
|
2010-01-25T13:38:07
|
|
Call event_debug_unassign on internal events
I don't expect that many users will be so religious about calling
unassign, but we need to be so that it's at least possible to use
debug mode without eating memory.
|
|
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.
|
|
ba2945f9
|
2010-01-06T17:59:44
|
|
Merge branch 'ratelimit'
Conflicts:
bufferevent_async.c
|
|
2e8eeea3
|
2009-12-29T19:50:03
|
|
Fix crash bugs when a bufferevent's eventcb is not set.
In many places throughout the code, we called _bufferevent_run_eventcb
without checking whether the eventcb was actually set. This would
work fine when the bufferevent's callbacks were deferred, but
otherwise the code would segfault. Strangely, we always remembered to
check before calling the _bufferevent_run_{read,write}cb functions.
To prevent similar errors in the future, all of
_buferevent_run_{read,write,event}cb now check to make sure the
callback is actually set before invoking or deferring the callback.
This patch also removes the now-redundant checks for {read,write}cb.
|
|
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.
|
|
5846bf6c
|
2009-12-22T15:51:39
|
|
Simplify the read high-watermark checking.
|
|
a773df54
|
2009-12-18T16:24:41
|
|
Fix a segfault when freeing SSL bufferevents in an unusual order
Have container bufferevents hold a reference to their underlying bufferevents.
(Commit message and minor revisions by nickm.)
|
|
0d744aa1
|
2009-11-23T18:34:32
|
|
Refactor our 'suspend operation' logic on bufferevents.
There are lots of things we do internally in bufferevents to indicate
"the user would like this operation to happen, but we aren't going to
try until some other condition goes away." Our logic here has gotten
entirely too complicated.
This patch tries to fix that by adding the idea of 'suspend flags' for
read and write. To say "don't bother reading or writing until
condition X no longer holds," bufferevent_suspend_read/write(bev,
BEV_SUSPEND_X). When X no longer holds, call
bufferevent_unsuspend_read/write(bev, BEV_SUSPEND_X).
Right now, only the read-watermark logic uses this.
|
|
438f9ed2
|
2009-11-23T15:53:24
|
|
Add the abilitity to mark some buffer callbacks as never-deferred.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
7c688dd9
|
2009-07-31T14:41:45
|
|
New function to expose bufferevent.enabled
svn:r1401
|
|
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
|
|
b06b2649
|
2009-07-26T01:29:39
|
|
Make "deferred callback queue" independent of event_base.
This way, we can more easily have an IOCP bufferevent implementation
that does not need an event_base at all. Woot.
svn:r1381
|
|
a62283a9
|
2009-07-17T17:46:17
|
|
Always hold a reference to a bufferevent when calling its callbacks.
Rationale: we hold a lock on the bufferevent when its callbacks are
executing, so we need to release the lock afterwards. But the
callback might free the bufferevent, so unless we're holding a
reference on the bufferevent, the lock might not be there for us to
release.
svn:r1347
|
|
a501d683
|
2009-07-10T19:34:00
|
|
Add a lock/unlock pair inside the event callbacks in bufferevents.
This fixes part of bug 2800642, I believe, though there is still a
general race condition in multithreaded use of events that we need to
think about.
svn:r1337
|
|
5232cfa3
|
2009-05-25T23:11:20
|
|
Consistently say "eventcb" instead of "errorcb"
svn:r1316
|
|
34574db0
|
2009-05-25T23:10:23
|
|
Add a generic mechanism to implement timeouts in bufferevents.
Paired and asynchronous bufferevents didn't do timeouts, and filtering
bufferevents gave them funny semantics. Now they all should all work
in a way consistent with what socket bufferevents do now: a [read/write]
timeout triggers if [reading/writing] is enabled, and if the timeout is
set, and the right amount of time passes without any data getting
[added to the input buffer/drained from the output buffer].
svn:r1314
|
|
59484297
|
2009-05-20T12:24:13
|
|
Fix a deadlock: there were some LOCKs that should have been UNLOCKs. Resolves bug 2794244
svn:r1298
|
|
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
|
|
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
|
|
b69d03b5
|
2009-05-05T14:18:14
|
|
Add a constructor for bufferevent_async.
svn:r1274
|
|
5a3eddf0
|
2009-05-02T16:24:05
|
|
Use fewer _compat.h headers in our own code.
svn:r1268
|
|
24607a39
|
2009-04-29T20:48:43
|
|
Note a place we might do better about lock releasing.
svn:r1252
|
|
a98a512b
|
2009-04-17T23:12:34
|
|
Add a generic way for any bufferevent to make its callback deferred
svn:r1197
|
|
91039e4d
|
2009-04-17T06:57:38
|
|
Add reference counts to bufferevents.
svn:r1189
|
|
a8f6d961
|
2009-04-17T06:56:09
|
|
Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h
svn:r1183
|
|
915193e7
|
2009-04-13T03:17:19
|
|
Locking support for bufferevents.
svn:r1170
|
|
1becc4c4
|
2009-04-13T03:08:11
|
|
Refactor new elements of bufferevent into bufferevent_private structure
This way we don't expose more of a bufferevent than we need to. One
motivation is to make it easier to automatically get deferred callbacks
with a bufferevent without exposing the deferred_cb structure.
svn:r1169
|
|
6a18f4b0
|
2009-04-05T04:15:01
|
|
Munge the read_suspended flag before re-enabling reads on the underlying bufferevent. This makes it so the enabled thing has some idea whether reads are supposed to be suspended or not.
svn:r1136
|
|
f1b1bad4
|
2009-04-03T14:27:03
|
|
Make the new evbuffer callbacks use a new struct-based interface.
The old interface would fail pretty hard when we had to batch up
multiple adds and drains in a single call.
svn:r1131
|
|
ea4b8724
|
2009-02-02T19:22:13
|
|
checkpoint work on big bufferevent refactoring
svn:r1095
|
|
b85b710c
|
2009-01-27T22:34:36
|
|
Update copyright statements to reflect the facts that:
a) this is 2009
b) niels and nick have been comaintainers for a while
c) saying "all rights reserved" when you then go on to explicitly
disclaim some rights is sheer cargo-cultism.
svn:r1065
|
|
8889a770
|
2009-01-27T22:30:46
|
|
Replace all use of config.h with event-config.h.
svn:r1064
|
|
9993137c
|
2009-01-27T21:10:31
|
|
Remove all trailing whitespace in all the source files.
svn:r1063
|
|
ec2f4cbc
|
2009-01-23T01:35:57
|
|
Move obsolete evbuffer function into include/event2/buffer_compat.h
svn:r1043
|
|
20c20466
|
2009-01-22T17:48:27
|
|
Use EV_PERSIST in bufferevents for efficiency and simplicity.
svn:r1038
|
|
169321c9
|
2009-01-13T20:26:37
|
|
Rename four internal headers to follow the -internal.h convention.
svn:r1000
|
|
81ab45ad
|
2009-01-13T19:20:04
|
|
Use new EVUTIL_ERR_*_RETRIABLE macros when we're testing an errno for blocking.
Previously, we used inconsistent and incompletely ported ifdefs.
(We don't use these macros in platform-specific files like evpoll.c, since
they don't need to work on win32.)
svn:r995
|
|
5e905c9d
|
2008-07-17T14:09:07
|
|
if we change the timeouts on bufferevents, we might have to readd pending events
svn:r911
|
|
8acb80b4
|
2008-05-08T22:51:39
|
|
r15551@tombo: nickm | 2008-05-08 14:49:20 -0400
Use _get_ convention for new accessor functions. (These are all new ones as of 2.0, I believe).
svn:r799
|
|
36d7ab50
|
2008-05-04T18:31:21
|
|
trust in naming: rename evbuffer.c to bufferevent.c
svn:r767
|