Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| 899b0a39 | 2010-05-24 15:24:03 | Use generic win32 interfaces, not ASCII-only ones, where possible. | ||
| 4ff247b2 | 2010-05-19 10:49:49 | Merge branch 'evdns_no_empty_handles' | ||
| 47c5dfbe | 2010-05-18 17:28:51 | Remove some dead assignments | ||
| b14f151b | 2010-05-18 17:27:06 | If no evdns request can be launched, return NULL, not a handle Some of our evdns code was willing to return an evdns_request with handle->current_req set to NULL. Really, those cases should just return NULL. | ||
| d14bb926 | 2010-05-18 14:05:01 | Use -Wlogical-op on gcc 4.5 or higher It exposed one bug for us (see 8c3452bcb294e07888), and might prevent more. | ||
| 8c3452bc | 2010-05-18 13:55:32 | Correctly recognize .255 addresses as link-local when looking for interfaces | ||
| bda21e7f | 2010-05-17 11:58:07 | Avoid close of uninitialized socket in evbuffer unit test Attempts to fix a crash bug found by Brodie Thiesfield. | ||
| caca2f45 | 2010-05-14 14:36:49 | Replace (safe) use of strcpy with memcpy to appease OpenBSD If Libevent uses strcpy, even safely, it seems OpenBSD's linker will complain every time a library links Libevent. It's easier just not to use the old thing, even when it's safe to do so. | ||
| 75701e89 | 2010-05-14 14:30:09 | Add some missing includes to fix Linux build again | ||
| b5bfc44d | 2010-05-13 15:38:39 | Make test-ratelim clean up after itself better. | ||
| 6d195109 | 2010-05-13 14:59:33 | Avoid event_del on uninitialized event in event_base_free This was mostly harmless, since the event was cleared with calloc, but still it's not a correct thing to do. | ||
| 2b44dcca | 2010-05-13 12:01:30 | Add options to test-ratelim.c to check its results The new options let you specify a maximum deviation of bandwidth used from expected bandwidth used, and make test-ratelim.c exit with a nonzero status when those deviations are violated. This patch also adds a test-ratelim.sh script to run test-ratelim with a few sensible options for testing. | ||
| 218a3c37 | 2010-05-13 11:24:07 | Do not check that event_base is set in EVBASE_ACQUIRE_LOCK In every place that we call EVBASE_ACQUIRE_LOCK, the base is either set, or must be set, so the test is redundant. | ||
| fdfc3fc5 | 2010-05-13 11:23:12 | Remove the now-unusable EVTHREAD_LOCK/UNLOCK constants | ||
| 33bbbed9 | 2010-05-13 10:57:30 | Mark the event_err() functions as __attribute__((noreturn)) This attribute tells gcc (and anything else that understands gcc attributes) that the functions will never return control, and helps the optimizer a little. With luck, it will also tell less-than-full-program dataflow analysis tools that they don't need to worry about any code path that involves calling one of these functions and then returning. This patch also forces event_exit() to always exit, no matter what the user-supplied fatal_callback does. This means that the old unit tests for the event_err* functions don't work any more, since they assume it is safe to call event_err* if you've given it a bogus fatal_callback that doesn't exit. Instead, we have to make the unit tests fork before calling event_err(), and have the main unit test process wait for the event_err() test to exit with a sane exit code. On unix, that's trivial. On windows, let's not bother and just assume that event_err* works. | ||
| dfb75ab2 | 2010-05-12 15:38:28 | Test the unlocked-deferred callback case of bufferevents | ||
| c5bab560 | 2010-05-11 11:44:07 | Remove the obsolete evthread interfaces These were added in 2.0.1, and deprecated in 2.0.4 and 2.0.5; we've promised that they would be removed, and warned whenever they were invoked. Users should call evthread_set_lock_callbacks instead... or ideally just call evthread_use_windows_threads or evthread_use_pthreads. | ||
| 9cb5bc86 | 2010-05-10 14:51:32 | Bump version to 2.0.5-beta-dev | ||
| ad9b7f15 | 2010-05-09 00:22:08 | Increment version numbers for 2.0.5-beta | ||
| f6aaf176 | 2010-05-09 00:16:35 | Add a changelog for 2.0.5-beta | ||
| 7c519dfd | 2010-05-08 23:29:29 | Fix some autoconf issues on OpenBSD Issue 1: autoconf gets accept when a header works properly with cpp but not with cc. This was true of the sys/sysctl.h header on openbsd. The fix: include sys/param.h (if present) when testing for sys/sysctl.h Issue 2: Somehow, autoconf's macro generation code is messed up on some versions of openbsd (including mine, and other people's too) so that instead of SIZEOF_VOID_P, it makes SIZEOF_VOID__. evutil/util.h now works around that. | ||
| c1cd32a1 | 2010-05-08 22:21:52 | Define _REENTRANT as needed on Solaris, elsewhere It turns out that _REENTRANT isn't only needed to make certain functions visible; we also need it to make pthreads work properly some places (like Solaris, where forgetting _REENTRANT basically means that all threads are sharing the same errno). Fortunately, our ACX_PTHREAD() configure macro already gives us a PTHREAD_CFLAG variable, so all we have to do is use it. | ||
| 3d9e05b1 | 2010-05-08 19:56:25 | Fix test.sh on freebsd It turns out that in all conformant shells, "unset FOO" removes FOO both from the shell's variables and from the exported environment. (I've tested this on msys, opensolaris, linux, osx, and freebsd.) And in nearly every shell I can find, "unset FOO; export FOO" does the same as unset FOO... except in my FreeBSD VM, where the "export FOO" sets the exported value of FOO equal to "". This broke test.sh for us. The fix is simple: remove the needless exports! | ||
| 0ee6f6ce | 2010-05-08 18:00:26 | Make test.sh support mingw/msys on win32 This required: - Adding another WIN32 section in test.sh - not running "touch /dev/null" - calling WSAStartup in all the test binaries - Fixing a dumb windows-only bug in test-time.c | ||
| 935e1504 | 2010-05-08 19:36:05 | Fix whitespace in evutil.c | ||
| 35570716 | 2010-05-08 19:16:47 | Fix another nasty solaris getaddrinfo() behavior Everybody else thinks that when you getaddrinfo() on an ip address and don't specify the protocol and the socktype, it should give you multiple answers , one for each protocol/socktype implementation. OpenSolaris takes a funny view of RFC3493, and leaves the results set to 0. This patch post-processes the getaddrinfo() results for consistency. | ||
| 2cf2a286 | 2010-04-21 11:57:55 | Fix getaddrinfo with protocol unset on Solaris 9. Found by Dagobert Michelsen Apparently when you call Solaris 9's getaddrinfo(), it likes to leave ai_protocol unset in the result. This is no way to behave, if I'm reading RFC3493 right. This patch makes us check for a getaddrinfo() that's broken in this way, and work around it by trying to infer socktype and protocol from one another. Partial bugfix for 2987542 | ||
| c44de06c | 2010-05-08 18:09:27 | Numerous opensolaris compilation fixes For future note, opensolaris doesn't have sys/sysctl.h, doesn't like comparing iov_buf to a chain_space_ptr without a cast, and is (predictably) unforgiving of dumb syntax errors. Also, we had accidentally broken the devpoll backend test in configure.in | ||
| f89168e7 | 2010-05-08 19:11:50 | Make test for bufferevent_connect_hostname system-neutral Previously, the be5_outcome field for the dns error would be set to something dependent on our system resolver. It turns out that you can't rely on nameservers to really give you an NEXIST answer for xyz.example.com nowadays: too many of them are annoyingly broken and like to redirect you to their locked-in portals. This patch changes the bufferevent_connect_hostname test so that it makes sure that the dns_error of be5_outcome is "whatever you would get from resolving the target hostname" | ||
| 88a543fc | 2010-05-08 19:09:09 | Make unit test for add_file able to tell "error" from "done" Importantly, we don't actually want to call evbuffer_write() when the buffer is empty. This makes it an error to ever get a -1 return value from evbuffer_add_file(), which makes it safe for us to test the return value. | ||
| 384d1245 | 2010-05-08 17:15:52 | Fix bench_http build on win32. | ||
| 05de45d6 | 2010-05-08 16:47:07 | add more (currently skipped) add_file tests on win32 | ||
| ad811cdc | 2010-05-08 16:41:01 | Fix unused-variable warning when building with threads disabled | ||
| dcdae6b7 | 2010-05-08 16:34:18 | Make evbuffer_add_file() work on windows Right now only the add_file() mode is supported, when it would be nicer to have mmap support. Perhaps for Libevent 2.1.x. | ||
| b4f12a17 | 2010-05-08 14:49:59 | Implement regress_make_tempfile on win32 to test evbuffer_add_file (Conclusion: evbuffer_add_file is broken on win32, since it uses recv on a file.) | ||
| 90d42251 | 2010-05-08 15:31:54 | Fix some crazy macro mistakes in arc4random.c | ||
| f37cd4c2 | 2010-04-21 12:25:29 | Detect broken unsetenv at unit-test runtime If we have an unsetenv function that doesn't work, we can't run the main/base_environ unit test, so we should skip it. | ||
| fdc62973 | 2010-05-06 14:37:23 | Only add libevent_core.la to LIBADD on mingw Chris Davis reports that this is also necessary to fix building with shared libraries on OSX for him. Should fix bug 2997775. There is probably a better fix for the issues solved by commit 3cbca8661f, but for now, we're trying to get a beta out the door. | ||
| 25433b96 | 2010-05-06 14:37:23 | Only specify -no-undefined on mingw It turns out that commit 3cbca8661f broke building with shared libraries on OSX. Since -no-undefined is only necessary on platforms like win32, only use it there. There may be a better fix for this. Should fix bug 2997775. | ||
| a62c8433 | 2010-05-06 14:16:50 | Merge commit 'chrisd/connect-hostname-report-err' | ||
| 7731ec88 | 2010-05-06 13:26:05 | Stop distributing and installing manpages: they were too inaccurate It would be great to have the manpages come back some time, perhaps from a refactoring of my asciidoc book, but for now the existing manpages were the single worst, most incomplete, and most misleading libevent documentation we had. (Less misleading: the doxygen output, the header files, and my reference book.) | ||
| c16e6844 | 2010-05-04 13:27:36 | Rename current_base symbol to event_global_current_base_ The "current_base" symbol was never actually declared in an exported header; it's hideously deprecated, and it was the one remaining exported symbol (fwict) that was prefixed with neither ev nor bufferevent nor _ev nor _bufferevent. codesearch.google.com turns up no actual attempts to use our current_base from outside libevent. | ||
| 99e50e90 | 2010-05-04 12:57:40 | Fix symbol conflict between mm_*() macros and libmm Our mm_malloc, mm_calloc, etc functions were all exported, since C hasn't got a nice portable way to say "we want to use this function inside our library but not export it to others". But they apparently conflict with anything else that calls its symbols mm_*, as libmm does. This patch renames the mm_*() functions to event_mm_*_(, and defines maros in mm_internal so that all the code we have that uses mm_*() will still work. New code should also prefer the mm_*() macro names. Reported by Gernot Tenchio. Fixes sf bug 2996541 | ||
| 20fda296 | 2010-05-03 13:00:00 | Try /proc on Linux as entropy fallback; use sysctl as last resort It turns out that the happy fun Linux kernel is deprecating sysctl, and using sysctl to fetch entropy will spew messages in the kernel logs. Let's not do that. Instead, let's call sysctl for our entropy only when all other means fail. Additionally, let's add another means, and try /proc/sys/kernel/random/uuid if /dev/urandom fails. | ||
| 71afc525 | 2010-05-03 11:37:16 | Fix nonstandard TAILQ_FOREACH_REVERSE() definition Every current BSD system providing TAILQ_* macros define TAILQ_FOREACH_REVERSE in this order: TAILQ_FOREACH_REVERSE(var, head, field, headname) However, libevent defines it in another order: TAILQ_FOREACH_REVERSE(var, head, headname, field) Here's a trivial patch to have libevent compatible with stock queue.h headers. -Frank. [From sourceforge patch 2995179. codesearch.google.com confirms that the only people defining TAILQ_FOREACH_REVERSE our way are people using it in a compatibility header like us. Did we copy this from OpenSSH or something?] -Nick | ||
| 953e2290 | 2010-05-03 11:29:22 | Refuse null keys in evhttp_parse_query() evhttp_parse_query() currently accepts empty keys, that don't make any sense. -Frank [From sourceforge patch 2995183] -Nick | ||
| bd1ed5f3 | 2010-05-02 12:51:35 | Fix a compile warning introduced in 739e688 | ||
| 739e6882 | 2010-04-28 21:33:13 | Allow empty reason line in HTTP status | ||
| 50ec59f4 | 2010-04-28 15:16:32 | Remove redundant checks for lock!=NULL before calling EVLOCK_LOCK The EVLOCK_LOCK and EVLOCK_UNLOCK macros already check to make sure that the lock is present before messing with it, so there's no point in checking the lock before calling them. A good compiler should be able to simplify code like if (lock) { if (lock) acquire(lock); } , but why count on it? | ||
| 40c301b7 | 2010-04-28 14:56:51 | Fix compilation when openssl support is disabled Previously, we'd fail if OpenSSL was present but openssl support was disabled. Now we don't. | ||
| 9ecf0d48 | 2010-04-28 12:03:08 | Catch attempts to enable debug_mode too late Debug mode needs to be enabled before any event is setup or any event_base is created. Otherwise, we will not have recorded when events were first setup or added, and so it will look like a bug later when we delete or free them. I have already confused myself because of this requirement, so let's make Libevent catch it for the next poor forgetful developer like me. | ||
| cb670740 | 2010-04-28 11:51:56 | Make debug mode catch mixed ET and non-ET events on an fd Of the backends that support edge-triggered IO, most (all?) do not support attempts to mix edge-triggered and level-triggered IO on the same FD. With debugging mode enabled, we now detect and refuse attempts to add a level-triggered IO event to an fd that already has an edge-triggered IO event, and vice versa. | ||
| a5208fe4 | 2010-04-27 13:42:26 | Release locks on bufferevents while executing callbacks This fixes a dead lock for me where bufferevents in different event loops use each other and access their input/output buffers (proxy-like scenario). | ||
| 0ef40706 | 2010-04-24 00:06:38 | Report DNS error when lookup fails during bufferevent_socket_connect_hostname. | ||
| 25c442e5 | 2010-04-24 00:15:15 | Merge branch 'rpc_leaks' | ||
| 601a3ff9 | 2010-04-24 00:01:31 | Merge branch 'arc4seed' | ||
| f6ab2a28 | 2010-04-23 23:55:30 | Fix a memory leak when unmarshalling RPC object arrays The old code would use type_var_add() for its side-effect of expanding the array, then leak the new object that was added to the array. The new code adds a static function to handle the array resizing. | ||
| 94ee1251 | 2010-04-23 23:55:03 | fix a leak when unpausing evrpc requests | ||
| 96730d31 | 2010-04-23 23:13:26 | Make http_base_test stop leaking an event_base. | ||
| d49b92a8 | 2010-04-23 23:04:20 | Remove one last bug in last_with_datap logic. Found with valgrind | ||
| 9d8edf2f | 2010-04-23 18:59:22 | do not leak the request object on persistent connections | ||
| a47a4b7e | 2010-04-23 16:08:09 | Fix a couple of bugs in the BSD sysctl arc4seed logic Of course, FreeBSD has its own arc4random() implementation, so this should never actually be needed. Still, it's good to paint the underside of the wagon. | ||
| a5bf43ab | 2010-03-04 01:14:32 | Document evutil_secure_rng_init() and evutil_secure_rng_add_bytes() | ||
| f9807167 | 2010-04-23 15:17:10 | Make evutil_secure_rng_init() work even with builtin arc4random | ||
| 71fc3eb0 | 2010-03-04 01:13:51 | Seed the RNG using sysctl() as well as /dev/urandom William Ahern points out that if the user has chrooted, they might not have a working /dev/urandom. Linux and many of the BSDs, however, define a sysctl interface to their kernel random number generators. This patch takes a belt-and-suspenders approach and tries to do use the sysctl _and_ the /dev/urandom approach if both are present. When using the sysctl approach, it tries to bulletproof itself by checking to make sure that the buffers are actually set by the sysctl calls. | ||
| b1c79500 | 2010-04-23 14:42:25 | Make evdns logging threadsafe The old logging code was littered with places where we stored messages in static char[] fields. This is fine in a single-threaded program, but if you ever tried to log evdns messages from two threads at once, you'd hit a race. This patch also refactors evdns's debug_ntop function into a more useful evutil_sockaddr_port_format() function, with unit tests. | ||
| ceefbe87 | 2010-04-23 14:04:03 | Add a comment to explain why evdns_request is now separte from request | ||
| 39b870b8 | 2010-04-22 21:49:05 | Add dns/search_cancel unit test. | ||
| 67072f3c | 2010-04-22 21:46:05 | Assert for valid requests as necessary. A valid request has an associated handle, and the handle must point to the request. | ||
| a6258400 | 2010-04-21 22:20:10 | Free search state when finished searching to avoid an infinite loop. | ||
| beaa14a4 | 2010-04-21 22:01:59 | Move domain search state to evdns_request. It doesn't seem to make sense to copy the state to each new request in the search. | ||
| 15bb82d6 | 2010-04-21 21:21:21 | Ensure that evdns_request is a persistent handle. When searching is enabled, evdns may make multiple requests before calling the user callback with the result. This is a problem because the same evdns_request handle is not retained for each search request, so the user cannot reliably cancel the request. This patch attempts to ensure that evdns_request persists accross search requests. | ||
| b84b598e | 2010-04-21 01:15:19 | Clean up properly when adding a signal handler fails. Previously, when a signation() or signal() call failed, we would free the element we added to sh_old, but not actually clear the pointer. This would leave a dangling pointer in sh_old that could cause a crash later. | ||
| 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) | ||
| 0861d170 | 2010-04-14 14:41:03 | Add ctags/etags files to .gitignore | ||
| 755fbf16 | 2010-04-14 14:27:29 | Add void* arguments to request_new and reply_new evrpc hooks This makes evprc setup more extensible, and helps with Shuo Chen's work on implementing Google protocol buffers rpc on top of Libevent 2 evrpc. This patch breaks binary compatibility with previous versions of Libevent, since it changes struct evrpc and the signature of evrpc_register_generic(). Since all compliant code should be calling evrpc_register_generic via EVRPC_REGISTER, it shouldn't break source compatibility. (Code by Shuo Chen; commit message by Nick) | ||
| 07edf784 | 2010-04-14 14:23:03 | Expose the request and reply members of rpc_req_generic() This code adds two accessor functions to evprc, and helps integrate evrpc with Google protocol buffers. (Code by Shuo Chen; commit message by nickm) | ||
| a0983b67 | 2010-04-14 00:36:09 | Initialize last_with_datap correctly in evbuffer_overlapped Fixes bug 2985406 | ||
| 3cbca866 | 2010-04-12 12:52:31 | Create shared libraries under Windows | ||
| 10c4c904 | 2010-04-12 12:50:17 | Do not inhibit automake dependencies generation It fixes make parallel builds. | ||
| d469c503 | 2010-04-12 12:18:57 | Fix compiler warnings under WIN32 | ||
| ab30e553 | 2010-04-13 01:46:29 | Merge branch 'evbuffer_copyout' | ||
| eb86c8c5 | 2010-04-12 22:24:54 | Add evbuffer_copyout to copy data from an evbuffer without draining The evbuffer_remove() function copies data from the front of an evbuffer into an array of char, and removes the data from the buffer. This function behaves the same, but does not remove the data. This behavior can be handy for lots of protocols, where you want the evbuffer to accumulate data until a complete record has arrived. Lots of people have asked for a function more or less like this, and though it isn't too hard to code one from evbuffer_peek(), it is apparently annoying to do it in every app you write. The evbuffer_peek() function is significantly faster, but it requires that the user be able to handle data in separate extents. This patch also reimplements evbufer_remove() as evbuffer_copyout() followed by evbuffer_drain(). I am reasonably confident that this won't be a performance hit: the memcpy() overhead should dominate the cost of walking the list an extra time. | ||
| fd902740 | 2010-04-10 11:26:53 | Merge branch 'safetimevalms' | ||
| 8f9e60c8 | 2010-04-09 19:16:09 | Always round up when there's a fractional number of msecs. | ||
| 819f949f | 2010-04-09 19:16:49 | Limit the maximum number of events on each socket to 65535 This lets us use less RAM for the evmap_io structure, which in turn can let us have fewer cache misses for evmap operations. | ||
| 99210dd9 | 2010-04-09 19:14:25 | Merge branch 'comment' | ||
| c247adc7 | 2010-04-09 13:32:08 | Add a few more evmap/changelist comments | ||
| 1234b95a | 2010-04-09 17:19:39 | Test another case of evbuffer_prepend | ||
| 8c83e995 | 2010-04-09 16:40:53 | Add more unit tests for evbuffer_expand | ||
| 06a4443a | 2010-04-09 15:28:26 | Unit-test every evbuffer_add_file() implementation. Previously, we'd only test the default one, even if the others were still compiled in. | ||
| 28bfed47 | 2010-04-02 19:08:32 | Clean up a mistake in pointer manipulation in evbuffer_remove | ||
| 850c3ff2 | 2010-03-31 20:30:55 | Add evutil_tv_to_msec for safe conversion of timevals to milliseconds. This is useful for backends that require their timeout values be in milliseconds. | ||
| d5ebcf37 | 2010-03-30 16:47:37 | Rewrite evbuffer_expand and its users The previous evbuffer_expand was not only incorrect; it was inefficient too. On all questions of time vs memory tradeoffs, it chose to burn time in order to avoid wasting memory. The new code tries to be a little more balanced: it only resizes an existing chain when doing so doesn't require too much copying, and when failing to do so would waste a lot of the chain's space. This patch also rewrites evbuffer_chain_insert to work properly with last_with_datap, and adds a few convenience functions to buffer.c. | ||
| 45068a31 | 2010-03-31 12:03:43 | Fix a memory leak when appending/prepending to a buffer with unused space. | ||
| 8e227b04 | 2010-03-27 00:09:25 | Make the no_iovecs case of write_atmost compile Apparently nobody had tested it before on a system that had sendfile. Why would you have sendfile and not writev? Perhaps you're trying to test the no-iovecs code to make sure it still works. | ||
| 96865c47 | 2010-03-30 12:48:56 | Turn the increasingly complex *_CHAIN() macros into functions | ||
| b7442f8e | 2010-03-26 23:18:40 | Replace last_with_data with a slightly smarter version To implement evbuffer_expand() properly, you need to be able to replace the last chunk that has data, which means that we need to keep track of the the next pointer pointing to the last_with_data chunk, not the last_with_data chunk itself. | ||
| cda56abf | 2010-03-31 12:29:26 | Fix critical bug in evbuffer_write when writev is not available evbuffer_pullup() returns NULL if you try to pull up more bytes than are there. But evbuffer_write_atmost would sometimes ask for more bytes to be pulled up than it had, get a NULL, and fail. | ||
| c87272b7 | 2010-03-26 14:51:39 | Make evbuffer_prepend handle empty buffers better If the first chunk of a buffer is empty, and we're told to prepend to the buffer, we should be willing to use the entire first chunk. Instead, we were dependent on the value of chunk->misalign. |