Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| 3a5cfb0d | 2010-02-28 12:49:03 | Add a changelog for 2.0.4-alpha from Git, sorted by hand | ||
| ad85908a | 2010-02-28 12:52:39 | Fix compilation with --disable-debug-mode | ||
| 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 | ||
| 98edb891 | 2010-02-25 17:14:41 | Fix arc4random compilation on MSVC. | ||
| 1e14f826 | 2010-02-25 17:11:28 | Try to define a sane _EVENT_SIZEOF_SIZE_T for msvc compilation | ||
| 23170a69 | 2010-02-25 16:57:57 | Fix mingw compilation | ||
| 7ffd3875 | 2010-02-24 13:40:06 | Delete stack-alloced event in new unit test before returning. | ||
| f3dfe462 | 2010-02-23 23:59:26 | Use new timeval diff comparison function in bufferevent test | ||
| 8fcb7a1b | 2010-02-23 23:55:32 | Add test for periodic timers that get activated for other reasons This was already independently verified by the new bufferevent timeout tests, but it's good to explicitly check that our code does what it should. | ||
| c02bfe12 | 2010-02-23 16:36:52 | Add a test for timeouts on filtering bufferevents. | ||
| 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. | ||
| 38ec0a77 | 2010-02-23 14:24:10 | Fix a bug in resetting timeouts on persistent events when IO triggers. When we fixed persistent timeouts to make them reset themselves based on the previous scheduled time rather than the current time... we made them do so regardless of whether the event was triggering because of a timeout or not! This was of course bogus. When a _timeout_ triggers, we should schedule the event for N seconds based on the last _schedule_ time... but when IO triggers, we should reset the timeout for N seconds after now. | ||
| e2642f0a | 2010-02-23 15:14:57 | Fix some race conditions in persistent events and event_reinit I found these by adding an EVENT_BASE_ASSERT_LOCKED() call to most of the functions in event.c that can only be called while holding the lock. event_reinit() never grabbed the lock, but it needed to. event_persist_closure accessed the base to call event_add_internal() and gettime() when its caller had already dropped the lock. event_pending() called gettime() without grabbing the lock. | ||
| 4b37e6a5 | 2010-02-23 00:39:02 | Merge remote branch 'github/split_free_from_decref' | ||
| 162ce8a8 | 2010-02-23 00:38:30 | Expose view of current rate limit as constrained by group limit | ||
| b2fbeb3f | 2010-02-22 15:38:23 | Make bufferevent_free() clear all callbacks immediately. This should end the family of bugs where we call bufferevent_free() while a pending callback is holding a reference on the bufferevent, and the callback tries to invoke the user callbacks before it releases its own final reference. This means that bufferevent_decref() is now a separate function from bufferevent_free(). | ||
| 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. | ||
| 4faeaea9 | 2010-02-19 03:39:50 | Clean up formatting: function/keyword spacing consistency. - Keywords always have a space before a paren. Functions never do. - No more than 3 blank lines in a row. | ||
| e5cf9879 | 2010-02-18 17:46:56 | Clean up formatting: remove trailing spaces | ||
| e5bbd40a | 2010-02-18 17:41:15 | Clean up formatting: use tabs, not 8-spaces, to indent. | ||
| 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. | ||
| b72be50d | 2010-02-18 13:52:04 | Add some headers to fix freebsd compilation | ||
| 1ba6bed8 | 2010-02-18 13:50:15 | Add the "compile" script to gitignore. | ||
| 48a29b68 | 2010-02-18 01:43:37 | Add a unit test for secure rng. Mostly, this is just to make sure our arc4random_buf() implementation isn't dumb. | ||
| ff2a134d | 2010-02-18 00:54:44 | Fix getpid() usage on Windows On Windows, getpid() is _getpid(), and requires that we first include <process.h>. arc4random.c previously didn't know that. Actually, I question whether arc4random needs to do its getpid() tricks on Windows. They exist only so that we remember to re-seed the ARC4 cipher whenever we fork... but Windows has no fork(), so I think we're in the clear. | ||
| cb52838f | 2010-02-18 00:27:35 | When working without a current event base, don't try to use IOCP listeners This fixes a bug turned up with the http unit tests, where we create the evhttp object using an implicit (NULL) event_base. This failed pretty badly when we tried to use IOCP-based listeners. We could hunt for the current base from inside listener.c in the future, or get the iocp base some other way, but for now this is probably the safest solution. | ||
| 32c6f1ba | 2010-02-15 19:54:15 | Construct Windows locks using InitializeCriticalSectionAndSpinCount Previously we were using InitializeCriticalSection, which creates a lock that blocks immediately on contention and waits to be rescheduled. This is inefficient; it's better to wait for a little while before telling the US to reschedule us, in case the lock becomes available again really soon (since most locks mostly do). Good pthreads implementations do this automatically. On Windows, though, we need to call this magic function, and we need to pick the spin count ourselves. | ||
| ca46d25b | 2010-02-17 23:02:28 | Merge branch 'arc4random' | ||
| e15e1e94 | 2010-02-17 22:54:43 | Add the arc4random.c license to the LICENSE file. | ||
| 7116bf23 | 2010-02-15 21:03:52 | Fix two unlocked reads in evbuffer. Some initializers (in evbuffer_read and evbuffer_commit) were reading the last and/or previous_to_last fields without grabbing the evbuffer lock. This may fix a hard-to-trigger race condition or two. | ||
| aae7db52 | 2010-02-15 17:53:24 | Update event-config.h version number to match configure.in | ||
| 60753da0 | 2010-02-15 17:07:26 | Merge commit 'niels/http_close_connection' | ||
| 63e868e6 | 2010-02-15 16:45:19 | Increment the submicro version number. We've changed a couple of APIs introduced in 2.0.1-alpha, so it behooves us to give high-needs apps (like Tor) a way to tell we've done this. Sensible apps will just say "is it 2.0.3-alpha or 2.0.4-alpha" and ignore the existence of 2.0.3-alpha-dev, which is just as it should be. | ||
| 2f782af3 | 2010-02-13 17:04:17 | validate close cb on server when client connection closes | ||
| e8a9782c | 2010-02-13 16:59:37 | clean up terminate_chunked test | ||
| 4ec8fea6 | 2010-02-13 00:11:44 | Make RNG work when we have arc4random() but not arc4random_buf() | ||
| 3fe60fdf | 2010-02-12 23:40:13 | Use off_t for the length parameter of evbuffer_add_file | ||
| d4de062e | 2010-02-10 17:19:18 | Add an arc4random implementation for use by evdns Previously, evdns was at the mercy of the user for providing a good entropy source; without one, it would be vulnerable to various active attacks. This patch adds a port of OpenBSD's arc4random() calls to Libevent [port by Chris Davis], and wraps it up a little bit so we can use it more safely. | ||
| 1dd7e6dc | 2010-02-05 01:16:23 | Remove the 'flags' argument from evdns_base_set_option() The 'flags' argument made sense when passed to evdns_(base_)?parse_resolv_conf when it said which parts of the resolv.conf file to obey. But for evdns_set_option(), it was really silly, since you wouldn't be calling evdns_set_option() unless you actually wanted to set the option. Its meaning was basically, "set this to DNS_OPTIONS_ALL unless you want a funny surprise." evdns_base_set_option was new in 2.0.1-alpha, so we aren't committed to keeping it source-compatible. | ||
| 6810bdb1 | 2010-02-05 13:50:51 | Always use our own gai_strerror() replacement. This is necessary if we have any errors that the platform gai_strerror() doesn't know how to handle. | ||
| c18490e6 | 2010-02-05 01:09:01 | Add a check to make soure our EVUTIL_AI flags do not conflict with the native ones | ||
| cfe7a9ff | 2010-02-04 10:15:39 | Merge remote branch 'niels/http_chunk' | ||
| a7a94310 | 2010-02-03 23:49:22 | Fix some additional -DUNICODE issues on win32. Brodie's patch didn't catch the ones that were new since 1.4. | ||
| 000a33ec | 2010-02-03 23:27:40 | Make Libevent 1.4.12 build on win32 with Unicode enabled. This patch fixes calls to the win32 api to explicitly call the char* versions of the functions. This fixes build failures when libevent is built with the UNICODE define. | ||
| 39781801 | 2010-02-03 16:54:18 | make evhttp_send() safe against terminated connections, too | ||
| e2d15d81 | 2010-02-03 17:52:55 | Merge remote branch 'niels/http_chunk' | ||
| 93d73691 | 2010-02-03 14:34:56 | do not fail while sending on http connections the client closed. when sending chunked requests via multiple calls to evhttp_send_reply_chunk, the client may close the connection before the server is done sending. this used to cause a crash. we introduce a new function evhttp_request_get_connection() that allows the server to determine if the request is still associated with a connection. If it's not, evhttp_request_free() needs to be called explicitly or the user can call evhttp_send_reply_end() which just frees the request, too. | ||
| 60742d58 | 2010-02-03 17:01:45 | Add the rest of the integer limits, and add a test for them. | ||
| 8f654678 | 2010-02-03 16:25:34 | Merge remote branch 'github/http_listener' Conflicts: http.c | ||
| 85047a69 | 2010-02-03 15:12:04 | Functions to view and manipulate rate-limiting buckets. We need these for Tor, and other projects probably need them too. Uses include: - Checking whether bandwidth is mostly-used, and only taking some actions when there's plenty of bandwidth. - Deducting some non-bufferevent activities from a rate-limit group. | ||
| aba1fff3 | 2010-02-03 14:37:42 | Add EV_*_MAX macros to event2/util.h to expose limits for ev_* types. | ||
| da6135e3 | 2010-02-03 02:09:19 | Reduce windows header includes in our own headers. It turns out that absolutely everything that was including windows.h was doing so needlessly; our headers don't need it, so we should just include winsock2.h (since that's where struct timeval is defined). Pre-2.0 code will use the old headers, which include windows.h for them, so we aren't breaking source compatibility with 1.4. This solves the bug where we were leaving WIN32_LEAN_AND_MEAN defined, in roughly the same way that buying an automobile solves the question of what to give your coachman for boxing day. | ||
| 27c9a40f | 2010-02-03 02:08:08 | Fix a dumb typo in ev_intptr_t definitions. We said "#define ev_uintptr_t" twice instead of ever saying "#define ev_intptr_t". | ||
| e244a2ea | 2010-02-03 01:26:07 | Add the msvc-generated .lib files to .gitignore. | ||
| 6c21c895 | 2010-02-03 01:22:44 | Remove EVUTIL_CHECK_FMT. This was never supposed to be an exposed API, so its name should have been more like _EVUTIL_CHECK_FMT. But it was only used in one place, so let's just eliminate it. | ||
| f6b26949 | 2010-02-03 01:16:47 | Deprecate EVENT_FD and EVENT_SIGNAL. These are old aliases for event_get_fd and event_get_signal, and they haven't been the preferred way of doing things since 2.0.1-alpha. For a while, we made them use struct event if it was included, but call event_get_(fd|signal) if it wasn't. This was entirely too cute. | ||
| d38a7a19 | 2010-02-02 15:44:10 | const-ify a few more functions in event.h | ||
| f4190bfb | 2010-01-27 01:47:36 | Update time-test.c to use event2 time-test.c wasn't crazy, but it used some old interfaces. There are probably more cleanups and explanations to do beyond the ones here. | ||
| d60a1bd5 | 2010-01-27 01:46:41 | Clarify status of example programs (That is, add comments to say that dns-example and le-proxy are recent and ugly; event-test is old and ugly.) | ||
| becb9f9c | 2010-01-27 01:46:23 | Add a new "hello world" sample program | ||
| 137f2c60 | 2010-01-26 12:08:34 | Try to fix a warning in hash_debug_entry Apparently some 64-bit platforms don't like it when you say unsigned hash(void *p) { return (unsigned)p; } even if you really honestly don't want the high bits of p. Perhaps they will tolerate it if I say the equivalent of unsigned hash(void *p) { return (unsigned) (uintptr_t) p; } | ||
| cef61a2f | 2010-01-26 12:08:17 | Use ev_[u]intptr_t types in place of [u]intptr_t | ||
| 1fa4c81c | 2010-01-26 12:06:41 | Add ev_[u]intptr_t to include/event2/util.h We already emulate most of the other useful bits of stdint.h, and we seem to have started to use uintptr_t in a few places throughout the code. Let's make sure we can continue to do so even on backwards platforms that don't do C99. | ||
| 439aea0d | 2010-01-25 14:07:01 | Try to untangle the logic in server_port_flush(). The logic that prevented the first loop in this function from being infinite was rather confusing and hard to follow. It seems to confuse some automatic analysis tools as well as me. Let's try to replace it with something more comprehensible. | ||
| 361da8f2 | 2010-01-25 13:54:14 | Note a missing ratelim function | ||
| a66e947b | 2010-01-25 13:44:56 | Use less memory for each entry in a hashtable Our hash-table implementation stored a copy of the hash code in each element. But as we were using it, all of our hash codes were ridiculously easy to calculate: most of them were just a matter of a load and a shift. This patch lets ht-internal be built in either of two ways: one caches the hash-code for each element, and one recalculates it each time it's needed. This patch also chooses a slightly better hash code for event_debug_entry. | ||
| a19b4a05 | 2010-01-25 13: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. | ||
| cd17c3ac | 2010-01-22 00: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-23 16: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. | ||
| 5c7a7bca | 2010-01-23 20:07:05 | Fix windows and msvc build | ||
| c8c6a897 | 2010-01-16 15:24:58 | Minimize epoll_ctl calls by using changelist The logic here is a little complex, since epoll_add must used called exactly when no events were previously set, epoll_mod must be used when any events were previously set, and epoll_del only called when the removing all events. | ||
| 918e9c5e | 2010-01-23 16:38:36 | Fix a number of warnings from gcc -pedantic | ||
| e2ca403f | 2010-01-23 16:23:45 | Make it compile under gcc --std=c89. | ||
| 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. | ||
| 7296971b | 2009-12-29 16:38:03 | Detect setenv/unsetenv; skip main/base_environ test if we can't fake them. Previously, we assumed that we would have setenv/unsetenv everywhere but WIN32, where we could fake them with putenv. This isn't so: some other non-windows systems lack setenv/unsetenv, and some of them lack putenv too. The first part of the solution, then, is to detect setenv/unsetenv/ putenv from configure.in, and to fake setenv/unsetenv with putenv whenever we have the latter but not one of the former. But what should we do when we don't even have putenv? We could do elaborate tricks to manipulate the environ pointer, but since we're only doing this for the unit tests, let's just skip the one test in question that uses setenv/unsetenv. | ||
| 97a8c790 | 2010-01-22 00:34:21 | Fix compilation of rate-limit code when threading support is disabled | ||
| 26e1b6f2 | 2010-01-21 01:51:40 | Remove some commented-out code in evutil | ||
| 8d4aaf90 | 2010-01-20 12:56:54 | Don't use a bind address for nameservers on loopback If the user sets a bind address to use for nameservers, and a nameserver happens to be on 127.0.0.1, the nameserver will generally fail. This patch alters this behavior so that the bind address is only applied when the nameserver is on a non-loopback address. | ||
| 06839503 | 2010-01-19 14: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. | ||
| 70670067 | 2010-01-19 13:55:53 | Add a LICENSE file so people can find our license easily For what it's worth, we are aware that "Copyright $YEAR $NAME" is sufficient notice of copyright on software under US law and Internationally, and saying Copyright (c) $YEAR $NAME is a bit nutty. The character sequence (c) has never been ruled to have the same force in US law as the actual copyright symbol, and that neither of these US-specific symbols adds anything of value beyond saying "Copyright" since the Berne convention took effect in the US back in 1989. Similarly, saying "all rights reserved" doesn't do anything magical unless your software goes in a time-warp back to when the Buenos Aires Convention was the general rule. (And what will they run it on back then?) And what would even lead you to say "All Rights Reserved" when you're explicitly granting most of those rights to anybody receiving the work in accordance with the 3-clause BSD license? But still the FOSS community retains these ritual notations out of a kind of cargo-cult lawyering. Who knows? Perhaps one day, if we write our copyright notices ineptly enough, John Frum will come and give us a DFSG-compatible license that everybody can get behind. (Also, I am not a lawyer. The above should not be taken as legal advice. -- Nick) | ||
| 4b9f307d | 2010-01-15 10:26:25 | Add a forgotten header (changelist-internal.h) | ||
| 85464579 | 2010-01-14 23:28:16 | Merge commit 'niels/http_dns' | ||
| 78a50fe0 | 2010-01-14 17:39:54 | forgot to add void to test function | ||
| 26714ca1 | 2010-01-14 17:05:00 | add a test for evhttp_connection_base_new with a dns_base | ||
| b8226390 | 2010-01-14 16:53:25 | move dns utility functions into a separate file so that we can use them for http testing | ||
| 5032e526 | 2010-01-14 15: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 | ||
| 3225dfb9 | 2010-01-14 17:04:08 | Remove kqueue->pend_changes. Since we're no longer writing directly to it from add/del, we don't need to worry about it changing as kq_dispatch releases the lock. We would make it a local variable, except that we wouldn't want to malloc and free it all the time. | ||
| 45e5ae37 | 2010-01-14 16:31:05 | Make kqueue use changelists. This fixes a bug in kqueue identified by Charles Kerr and various Transmission users, where adding and deleting an event in succession would make the event get reported, even if we didn't actually want to see it. Of course, this also makes the array of changes passed to kevent smaller, which could help performance. | ||
| 27308aae | 2010-01-14 16:30:40 | Changelist code to defer event changes until just before dispatch This is necessary or useful for a few reasons: 1) Sometimes applications will add and delete the same event more than once between calls to dispatch. Processing these changes immediately is needless, and potentially expensive (especially if we're on a system that makes one syscall per changed event). Yes, this actually happens in practice for nonpathological code, such as in cases where the user's callback conditionally re-adds a non-persistent event, or where draining a buffer turns off writing and invokes a user callback which adds more data which in turn re-enabled writing. 2) Sometimes we can coalesce multiple changes on the same fd into a single syscall if we know about them in advance. For example, epoll can do an add and a delete at the same time, but only if we have found out about both of them before we tell epoll. 3) Sometimes adding an event that we immediately delete can cause unintended consequences: in kqueue, this makes pending events get reported spuriously. | ||
| ec34533a | 2009-12-30 00:41:03 | Make http use evconnlistener. Now that we have a generic listen-on-a-socket mechanism, there's no longer any reason to have a separate listen-on-a-socket implementation in http.c. This also lets us use IOCP and AcceptEx() when they're enabled. Possibly, we should have a new mechanism to add a socket given only a listener. | ||
| c698b77d | 2009-12-30 00: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. | ||
| a334b31c | 2010-01-14 14:46:16 | More unit tests for getaddrinfo_async: v4timeout and cancel. One covers the case where the v4 request times out but the v6 request doesn't. The other makes sure that cancelling a request actually works. | ||
| 94131e92 | 2010-01-12 15:58:36 | Fix test.sh on shells without echo -n Some systems have a version of /bin/sh whose builtin echo doesn't support the -n option used in test/test.sh. /bin/echo, however, usually does. This patch makes us use /bin/echo for echo -n whenever it is present. Also, our use of echo -n really only made sense when suppressing all test output. Since test output isn't suppressed when logging to a file, this pach makes us stop using echo -n when logging to a file. | ||
| b9f43b23 | 2010-01-11 20:47:36 | Add a comment on evthread_enable_lock_debuging. | ||
| 6cc79c6b | 2010-01-11 19:04:11 | Add unit-test for bad_request bug fixed in 1.4 recently. This is a partial forward-port from 4fd2dd9d83a000b6. There's no need to forward-port the bugfix, since the test passes with http.c as-is. I believe we fixed this while we were porting evhttp to bufferevent. --nickm | ||
| 510ab6bc | 2009-12-30 19:24:39 | Comestic changes in evconnlistener_new(), new_accepting_socket(), accepted_socket_invoke_user_cb() and iocp_listener_enable(). | ||
| fec66f96 | 2009-12-30 19:22:23 | Improved error handling in evconnlistener_new_async(). Also keeping the fd open because it is not opened by this function, so the caller is responsible for closing it. Additionally, since evconnlistener_new_bind() creates a socket and passes it to the function above, it required error checking to close the same socket. | ||
| 4367a33a | 2009-12-30 19:09:14 | Fixed a fd leak in start_accepting(), plus cosmetic changes |