Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| 0ba0af9c | 2011-09-29 09:30:04 | Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. The sendfile() implementation for evbuffer_add_file is potentially more efficient, but it has a problem: you can only use it to send bytes over a socket using sendfile(). If you are writing bytes via SSL_send() or via a filter, or if you need to be able to inspect your buffer, it doesn't work. As an easy fix, this patch disables the sendfile-based implementation of evbuffer_add_file on an evbuffer unless the user sets a new EVBUFFER_FLAG_DRAINS_TO_FD flag on that evbuffer, indicating that the evbuffer will not be inspected, but only written out via evbuffer_write(), evbuffer_write_atmost(), or drained with stuff like evbuffer_drain() or evbuffer_add_buffer(). This flag is off by default, except for evbuffers used for output on bufferevent_socket. In the future, it could be interesting to make a best-effort file segment implementation that tries to send via sendfile, but mmaps on demand. That's too much complexity for a stable release series, though. | ||
| e6af35d7 | 2011-08-24 21:39:28 | Correctly terminate IO on an async bufferevent on bufferevent_free | ||
| 7c11e51e | 2011-08-27 05:48:11 | Clean up some problems identified by Coverity. | ||
| 65707d7c | 2011-04-11 17:40:14 | add some (void) casts for unused variables All these places already have an XXX marker, so we know we need to fix them later. Let's not clutter the static analysis results with them. | ||
| 7bcace2d | 2010-11-22 21:02:34 | Fix some irix compilation warnings spotted by Kevin Bowling | ||
| 7484df61 | 2010-11-01 13:43:43 | Fix even more win64 warnings | ||
| 598d1336 | 2010-10-27 22:57:53 | Try to clear up more size_t vs int/long issues. | ||
| ec347b92 | 2010-07-07 16:45:03 | Move event-config.h to include/event2 This change means that all required include files are in event2, and all files not in event2/* are optional. | ||
| 0ef40706 | 2010-04-24 00:06:38 | Report DNS error when lookup fails during bufferevent_socket_connect_hostname. | ||
| 899c1dcc | 2010-04-14 15: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) | ||
| 657d1b6d | 2010-03-13 01:06:57 | Set mem_offset for every bufferevent type | ||
| b34abf30 | 2010-03-12 18:36:18 | Do not close(-1) when freeing an uninitialized socket bufferevent | ||
| 17efc1cd | 2010-03-04 01:25:51 | Update all our copyright notices to say "2010" | ||
| 57b72488 | 2010-02-27 22:27:13 | Small cleanups on freebsd-connect-refused patch. There should be no need to call be_socket_enable: that does an event_add(). What we really want to do is event_active(), to make sure that the writecb is executed. Also, there was one "} if () {" that was missing an else. I've noted that the return value for evutil_socket_connect() is getting screwy, but since that isn't an exported function, we can fix it whenever. | ||
| 7bc48bfd | 2010-02-27 18:59:06 | deal with connect() failing immediately | ||
| d3288293 | 2010-02-20 18: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. | ||
| db08f640 | 2010-02-20 12:55:59 | Suspend read/write on bufferevents during hostname lookup When we're doing a lookup in preparation for doing a connect, we might have an unconnected socket on hand, and mustn't actually do any reading or writing with it. | ||
| 8fdf09c0 | 2010-02-18 17:08:50 | Clean up formatting: Disallow space-before-tab. | ||
| 7515de91 | 2010-02-18 14:50:44 | When connect() succeeds immediately, don't invoke the callback immediately. We need this to get unit tests to pass on freebsd. | ||
| ff3f6cd4 | 2010-01-22 16: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-06 17:59:44 | Merge branch 'ratelimit' Conflicts: bufferevent_async.c | ||
| 2e8eeea3 | 2009-12-29 19: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. | ||
| 82743794 | 2009-12-24 17:47:14 | Do not make bufferevent_setfd implicitly disable EV_READ and EV_WRITE. This obviates the need for BEV_SUSPEND_CONNECTING, and good riddance. | ||
| 737c9cd8 | 2009-11-27 13: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. | ||
| 4a5b5343 | 2009-12-23 07: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. | ||
| cf749e22 | 2009-11-18 21:16:53 | Add a temporary workaround for an ssl bug found on FreeBSD. Basically, we only want to report the 'connected' event because of the socket connect() finishing when we have an actual socket bufferevent; on an SSL bufferevent, 'connected' means 'SSL connection finished.' This isn't FreeBSD's fault: it just has a connect() that tends to succeed pretty early. svn:r1548 | ||
| d7d1f1da | 2009-11-17 20: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 | ||
| 86f57420 | 2009-11-16 22: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 | ||
| 784b8773 | 2009-11-06 21: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 | ||
| 86db1c85 | 2009-11-04 05: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 | ||
| 6ca32df1 | 2009-11-04 03:54:05 | Add a missing include for win32. svn:r1498 | ||
| 0b9eb1bf | 2009-11-03 20: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 | ||
| 2e36dbe1 | 2009-10-26 20:00:43 | Use EVUTIL_ASSERT() consistently instead of assert. svn:r1464 | ||
| 38aec9ec | 2009-10-23 22:38:35 | Tweaks to IOCP interface. svn:r1461 | ||
| 879420a7 | 2009-10-23 22:00:29 | Expose a narrow window to the IOCP code. svn:r1459 | ||
| b73ad7bc | 2009-10-21 18: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 | ||
| e3fd294a | 2009-10-16 13:19:57 | Spelling fixes in comments and strings. svn:r1445 | ||
| 25af6954 | 2009-10-14 00:46:47 | When a bufferevent_connect() call fails, give the client an error callback. Patch from Christopher Davis. svn:r1444 | ||
| f65b8b09 | 2009-08-19 20: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 | ||
| eff09a29 | 2009-08-14 20:06:48 | tab/whitespace fixes in bufferevent_sock.c Also note that write() doesn't usually say 0. svn:r1414 | ||
| 800f9aa6 | 2009-08-09 20: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 | ||
| d1a2254b | 2009-07-30 20:41:31 | Fix some bugs in bufferevent_socket_connect svn:r1398 | ||
| 709c21c4 | 2009-07-28 04: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 | ||
| a62283a9 | 2009-07-17 17: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-10 19: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-25 23:11:20 | Consistently say "eventcb" instead of "errorcb" svn:r1316 | ||
| 31d89f27 | 2009-05-13 20: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-13 20: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-05 02: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 | ||
| 5a3eddf0 | 2009-05-02 16:24:05 | Use fewer _compat.h headers in our own code. svn:r1268 | ||
| eda27f95 | 2009-04-19 20:54:12 | Update copyright notices, add some missing license statements svn:r1208 | ||
| a98a512b | 2009-04-17 23:12:34 | Add a generic way for any bufferevent to make its callback deferred svn:r1197 | ||
| a8f6d961 | 2009-04-17 06:56:09 | Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h svn:r1183 | ||
| 915193e7 | 2009-04-13 03:17:19 | Locking support for bufferevents. svn:r1170 | ||
| 1becc4c4 | 2009-04-13 03: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 | ||
| 23085c92 | 2009-04-10 15:01:31 | Add a linked-pair abstraction to bufferevents. The new bufferevent_pair abstraction works like a set of buferevent_sockets connected by a socketpair, except that it doesn't require a socketpair, and therefore doesn't need to get the kernel involved. It's also a good way to make sure that deferred callbacks work. It's a good use case for deferred callbacks: before I implemented them, the recursive relationship between the evbuffer callback and the read callback would make the unit tests overflow the stack. svn:r1152 | ||
| 72b6ffe8 | 2009-04-08 03:05:42 | Prevent unsupported modifications to bufferevent_sock buffers. In particular, we don't allow adding any data to end front of inbuf (we do that when we read), or removing it from the front of outbuf (we drain data only when we write). svn:r1144 | ||
| f1b1bad4 | 2009-04-03 14: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 | ||
| 3502a472 | 2009-02-02 21:24:04 | convert new bufferevent_*.c files to event-config.h only. svn:r1097 | ||
| ea4b8724 | 2009-02-02 19:22:13 | checkpoint work on big bufferevent refactoring svn:r1095 |