Log

Author Commit Date CI Message
Nick Mathewson 127d4f21 2010-09-23T16:49:58 Add a LEV_OPT_THREADSAFE option for threadsafe evconnlisteners
Nick Mathewson 5b7a3706 2010-10-05T14:29:48 Fix warnings on mingw with gcc 4.5
Nick Mathewson 145f221e 2010-10-05T13:06:32 Define symbolic constants to use in place of SHUT_RD etc
Christopher Davis e0fd8708 2010-10-05T13:01:54 Send a shutdown(SHUT_WR) before closing an http connection This avoids getting an ECONNRESET from the TCP stack. Fixes bug 2928690
Nick Mathewson 0faaee01 2010-09-30T23:15:47 Fix a spurious-call bug on epoll.c We were trying to check whether any events had really been notified on an fd before calling evmap_io_active on it, but instead we were checking for an event pointer, which was always true. In practice, this patch shouldn't change much, since epoll_wait shouldn't return an event unless there is actually an event going on. Spotted by an anonymous bug reporter on Sourceforge. Closes bug 3078425.
Nick Mathewson a8b7674c 2010-09-28T01:09:17 Merge remote branch 'github/signed_compare'
Nick Mathewson a78ac0fa 2010-09-27T16:05:20 Merge remote branch 'github/win_lib'
Nick Mathewson d49b5e33 2010-09-27T15:12:55 Do not search outside of the system directory for windows DLLs Hardens against some attacks.
Sebastian Hahn b3953927 2010-09-27T21:14:28 Fix compile in kqueue.c Commit 38d09606 removed the evsigbase pointer, but forgot to remove an assignment to it in kqueue.c.
Nick Mathewson 9c8db0f8 2010-09-23T22:45:55 Fix all warnings in the main codebase flagged by -Wsigned-compare Remember, the code int is_less_than(int a, unsigned b) { return a < b; } is buggy, since the C integer promotion rules basically turn it into int is_less_than(int a, unsigned b) { return ((unsigned)a) < b; } and we really want something closer to int is_less_than(int a, unsigned b) { return a < 0 || ((unsigned)a) < b; } . Suggested by an example from Ralph Castain
Nick Mathewson 045eef4c 2010-09-23T14:23:45 Unit tests for listener error callbacks
Simon Perreault c4be8d82 2010-09-20T12:47:39 Add error callback to evconnlistener
Nick Mathewson e1198997 2010-09-21T22:44:39 Make event.c debugging messages report fds
Nick Mathewson ec2b05ed 2010-09-21T22:23:32 Make debugging output for epoll backend more comprehensive
Nick Mathewson 38d09606 2010-09-15T12:50:31 Remove event_base.evsigbase; nothing used it.
Nick Mathewson 4858b794 2010-09-15T01:54:51 Remove the now-useless evsig_caught and evsig_process
Nick Mathewson 95a7d418 2010-09-15T01:40:02 Make default signal backend fully threadsafe Jason Toffaletti discovered with helgrind that our signal handler was messing with evsig_base, which can be set from lots of places in the code. Ordinarly, we'd just stick a lock on it, except that it is illegal (and genuinely error-prone) to call pthread_mutex_acquire() from inside a signal handler. The solution is to only store the fd we write to in a static variable, write the signal number to the fd, and put evsig_cb in charge of activating signal events. I have no idea how we'll cope if we want to enable this to handle siginfo (where available) in the future.
Nick Mathewson 720bd933 2010-09-15T01:08:39 Warn when using the error-prone EV_SIGNAL interface in an error-prone way. Also, fix a couple of race conditions in signal.c When using the signal.c signal backend, Libevent currently only allows one event_base to actually receive signals at a time. (This has been the behavior since at least 1.4 and probably much earlier.) Now, we detect and warn if you're likely to be racing about which signal goes to which thread. We also add a lock to control modifications of the evsig_base field, to avoid race conditions like those found by Jason Toffaletti. Also, more comments. Comments are good.
Simon Perreault 040a019f 2010-09-09T17:19:20 Obey enabled status when unsuspending
Nick Mathewson f0bd83ea 2010-09-09T16:13:09 Bump to the latest version of tinytest This lets us do without libevent-specific code in tinytest.c, and lets us add a feature to skip individual tests from the command line.
Nick Mathewson a5ce9ad4 2010-09-09T16:01:42 Make SSL tests cover enabling/disabling EV_READ. I want my 80% coverage.
Nick Mathewson 5811d74c 2010-09-09T15:59:18 Bump version to 2.0.7-rc-dev
Nick Mathewson fe008ed6 2010-09-09T14:59:27 Make all versioning changes for 2.0.7-rc, and add ChangeLog
Christopher Davis d98511c0 2010-09-09T14:36:45 Make event_base_virtual_del() notify the base if needed
Nick Mathewson 2756a10c 2010-09-09T13:43:31 Add a missing time.h include to test/regress_thread.c
Nick Mathewson fb36f9a7 2010-09-09T13:00:54 Fix an uninitialized-variable warning on windows
Christopher Davis 71b68014 2010-09-08T20:33:21 Don't decrement virutal event count twice in connect_complete.
Christopher Davis 3ec65d69 2010-09-08T19:55:13 Fix a few Windows compile warnings.
Nick Mathewson 25b6a74b 2010-09-08T14:53:57 Merge branch 'tests'
Nick Mathewson 6f821710 2010-09-08T14:52:37 Merge remote branch 'github/win_notify'
Nick Mathewson de412948 2010-09-08T14:52:24 Add a missing header for regress_thread.c
Nick Mathewson e7dc501e 2010-09-08T14:40:51 Implement EVBASE_NEED_NOTIFY on win32
Sebastian Hahn 911e0db8 2010-09-08T20:29:39 Fix a compile warning in regress_thread.c
Nick Mathewson 3658b169 2010-09-08T14:12:12 Merge remote branch 'chrisd/iocp-fixes4' Conflicts: test/regress_thread.c
Nick Mathewson 9580e282 2010-09-08T14:00:45 Merge branch 'th_notify_fd_reinit'
Nick Mathewson ce85280b 2010-09-08T13:29:06 Improve testing of when thread-notification occurs
Nick Mathewson 4632b78e 2010-09-08T13:22:55 Minimize calls to base_notify implementation functions, thereby avoiding needless syscalls The trick here is that if we already told the base to wake up, and it hasn't woken up yet, we don't need to tell it to wake up again. This should help lots with inherently multithreaded code like IOCP.
Nick Mathewson c7a06bfa 2010-09-08T13:02:58 Avoid needlessly calling evthread_notify_base() when the loop is not running Also make sure that we always hold the base lock when calling evthread_notify_base.
Nick Mathewson 57d3413c 2010-09-08T11:39:24 Merge remote branch 'github/globals'
Christopher Davis 17a14f1a 2010-09-01T11:04:57 Only process up to MAX_DEFERRED deferred_cbs at a time. If threads queue callbacks while event_process_deferred_callbacks is running, the loop may spin long enough to significantly skew timers. A unit test stressing this behavior is also in this commit.
Christopher Davis 2447fe88 2010-08-28T04:07:48 Add event_config_set_num_cpus_hint for tuning thread pools, etc.
Christopher Davis 499452f4 2010-08-28T02:44:11 IOCP-related unit test tweaks
Christopher Davis 76f7e7ae 2010-08-17T05:02:00 Some IOCP bufferevent tweaks. - Increment reference count of bufferevents before initiating overlapped operations to prevent the destructor from being called while operations are pending. The only portable way of canceling overlapped ops is to close the socket. - Translate error codes to WSA* codes. - Better handling of errors. - Add an interface to add and del "virtual" events. Because IOCP bufferevents don't register any events with the base, the event loop has no way of knowing they exist. This causes the loop to terminate prematurely. event_base_{add,del}_virtual increment/decrement base's event count so the loop runs while there are any enabled IOCP bufferevents.
Christopher Davis d844242f 2010-08-28T02:08:27 Stop IOCP when freeing the event_base.
Christopher Davis 03afa209 2010-08-16T01:23:57 IOCP-related evbuffer fixes. - Prevent evbuffer_{add,prepend}_buffer from moving read-pinned chains. - Fix evbuffer_drain to handle read-pinned chains better. - Raise the limit on WSABUFs from two to MAX_WSABUFS for overlapped reads.
Nick Mathewson 1115366e 2010-09-07T10:28:15 Fix a few memory leaks in the tests
Nick Mathewson 42090072 2010-09-06T15:47:07 Move the "function to getsockname() on a listener" to regress_testutils This reverts commit fab50488fcb741884ccdfa7b83643eac3e5c9cbf. The function was, on reflection, not important enough to break the feature freeze, since it's trivial to build on your own.
Nick Mathewson c51826ff 2010-09-06T15:40:13 Merge remote branch 'github/sysqueue_include_order'
Shuo Chen b0f284cb 2010-09-06T10:10:17 Fix event_del(0) instance in bench.c
Nick Mathewson 749128b2 2010-09-04T22:02:32 Merge remote branch 'github/win32_posix_underscore'
Nick Mathewson 150599e6 2010-09-04T22:00:38 Merge remote branch 'github/cdecl'
Nick Mathewson b5dd8064 2010-09-03T22:00:25 Fix uninitialized port var in http_delete_test. Last one, I hope.
Nick Mathewson 3b3fb743 2010-09-03T21:03:25 Fix uninitialized variables in http_bad_request_test. (oops)
Nick Mathewson a97320ac 2010-09-03T18:48:31 Allow more than one copy of regression tests to run at once Mostly this was a matter of just removing all the hardwired ports in the test code. The http/connection_retry test is still a little screwy, though.
Nick Mathewson 19521436 2010-09-03T16:42:16 Expose a function to add a nameserver by sockaddr
Nick Mathewson fab50488 2010-09-03T16:41:16 Expose a function to getsockname() on a listener's fd.
Nick Mathewson 7ea8e89d 2010-09-03T15:12:35 Prefer autoreconf -ivf to manual autogen.sh Suggested by Ralph Castain
Nick Mathewson 47882773 2010-09-02T13:21:17 Fix pointer-to-__cdecl-function syntax
Nick Mathewson e50c0fcc 2010-09-02T11:10:50 Use the _func() replacements for open, fstat, etc in evutil.c on win32 Remember that in a fit of ANSI C compliance, Microsoft decided to screw portability by renaming basically all the functions in unistd.h to get prefixed with an understore. For some reason, mingw didn't seem to mind, but at least some people's compilers did: see bug 3044490.
Nick Mathewson f0056d04 2010-09-02T12:06:58 Declare signal handler function as "__cdecl" on Windows. I swear, they must have half a dozen different calling conventions. (goes to check) Holy crud. They actually do. There's __cdecl, __stdcall, __fastcall, "thiscall", "naked" and the obsolete "__pascal", "__fortran", and "__syscall". And don't forget WINAPI and __far. Anyways, this should fix 3044488 if I got it right.
Nick Mathewson ca9048f1 2010-09-02T11:36:44 Move evkeyvalq into a separate header for evhttp_parse_query users The evhttp_parse_query API is a bit misdesigned; all the other evkeyvalq stuff is abstract and lets you get away with having a header stub, but evhttp_parse_query seems to require that you instantiate an empty evkeyvalq of your own.
Nick Mathewson d3ceca80 2010-09-02T11:27:57 Declare evkeyvalq and event_list even if event_struct.h comes before sys/queue.h Fixes bug 3036645 reported by Mihai Draghicioiu
Nick Mathewson 495ed667 2010-09-01T16:36:30 Close th_notify_fds and open a new pair on reinit After a fork, you want subthreads to wake up the event_base in the child process, not to have the child process and the main process fight over who wakes up whom. Related to a problem found by Nicholas Marriott while debugging 3048812.
Nick Mathewson 5de2bcb7 2010-09-01T16:03:39 On windows, make lock/thread function tables static This requires us to have a separate implementation of the lock macros that indirects to a set of functions. Fortunately, this isn't too hard to do. This may be a fix for bug 3042969, where our openssl dll and our libevent dll each got their own version of the thread stuff.
Nick Mathewson 5218d2a8 2010-09-01T15:56:22 Make defer-internal.h use lock macros, not direct cess to lock fns
Nick Mathewson 1fdec20f 2010-09-01T15:01:39 Stop using global arrays to implement the EVUTIL_ctype functions These apparently made libtool sad on win32, and the function call overhead here should be negligable anyway.
Nick Mathewson acc4aca4 2010-08-30T11:35:06 Fix a bug in our win32 condition implementation The do ... while loop in our wait code could spin while waiting because the event object wasn't reset until there were no longer any events waiting to be woken up. We also want to reset the event object if the count of events to wake up reaches zero. Found by Chris Davis. Fixes bug 3053358.
Nick Mathewson d61b2f33 2010-08-26T15:09:58 Fix an issue with forking and signal socketpairs in select/poll backends Nicholas Marriott identifies an issue where a signal socketpair doesn't get recreated if the event backend doesn't set event_reinit. See bug 3048812 There may be a similar issue with respect to th_notify_fd
Nick Mathewson 041989fb 2010-08-17T14:44:12 Rename regress_pthread.c to regress_thread.c
Nick Mathewson f1074b77 2010-08-23T12:01:45 Detect events with no ev_base; warn instead of crashing
Nick Mathewson 743f8665 2010-08-23T11:48:46 Honor NDEBUG; build without warnings with NDEBUG; make NDEBUG always-off in unit test code
Nick Mathewson 970e6ad2 2010-08-19T14:00:06 Avoid deadlock when activating signals. Fixes bug 3048812. Based on patch by Nicholas Marriott.
Nick Mathewson 6123d129 2010-08-19T09:38:44 Fix kquue correctness test on x84_64 Apparently, in our configure.in check for a working kqueue, we were leaving some fields unset that seemed to irritate 64-bit kqueue a lot. Found by Christopher Layne
Nick Mathewson 4c32b9de 2010-08-18T12:02:25 Fix logic error in win32 TRY_LOCK that caused problems with rate-limiting
Nick Mathewson d0b88433 2010-08-18T10:49:12 Set close-on-exec bit for filedescriptors created by dns subsystem. Based on patch for 1.4 by Ralf Schmitt.
Nick Mathewson da6e7cd4 2010-08-17T13:26:03 Correctly detect failure to delete bufferevent read-timeout event Gilad Benjamini noted that we check the error code for deleting a write-timeout event twice, and the read timeout not at all. This shouldn't be a bit problem, since it's really hard for a delete to fail on a timeout-only event, but it's worth fixing. Fixes bug 3046787
Nick Mathewson 5fb10958 2010-08-16T22:55:45 Add a unit test for conditions
Nick Mathewson d74ae381 2010-08-16T12:38:22 Make the regress_pthread.c tests work on windows with current test APIs
Nick Mathewson e0972c21 2010-08-17T13:18:18 Use conditions instead of current_event_lock to fix a deadlock. Avi Bab correctly noted as bug 3044479 the fact that any thread blocking on current_event_lock will do so while holding th_base_lock, making it impossible for the currently running event's callback to call any other functions that require th_base_lock. This patch switches the current_event_lock code to instead use a condition variable that we wait on if we're trying to mess with a currently-executing event, and that we signal when we're done executing a callback if anybody is waiting on it.
Nick Mathewson d4977b52 2010-08-17T13:15:34 Add a condition variable backend, with implementations for pthreads and win32 The interface from the user's POV is similar to the locking implementation: either provide a structure full of function pointers, or just call evthread_use_*_threads() and everything will be okay. The internal interface is meant to vaguely resemble pthread_cond_*, which Windows people will better recognize as *ConditionVariable*.
Gilad Benjamini 39201728 2010-08-13T17:19:18 Make definition of WIN32_LEAN_AND_MEAN in event.h conditional. (Inclusion order might trigger a warning for redefinition on Windows.)
Gilad Benjamini 60433a0a 2010-08-13T17:08:59 Clean up syntax on TAILQ_ENTRY() usage Though the C standards allow it, it's apparently possible to get MSVC upset by saying "struct { int field; } (declarator);" instead of "struct {int field; } declarator;", so let's just not do that. Bugfix for 3044492 (commit msg by nickm)
Nick Mathewson a4af9be1 2010-08-13T11:41:37 Make include/event2/event-config.h not included in source dist As a generated file, it shouldn't get included in our source distribution. Apparently there is an automake incant for this: nobase_ even stacks with nodist_ .
Nick Mathewson 4022b287 2010-08-13T11:34:39 Change include order in Makefile.nmake If there is an event-config.h in include/event2 (either because we screwed up packaging like in 2.0.6-rc or because we previously tried building with mingw and we didn't make distclean in the middle), we want MSVC to find the one one in WIN32-Code/include/event2 first. Found by Gilad Benjamini.
Nick Mathewson 4991669b 2010-08-10T21:05:52 Update the whatsnew-2.0.txt document
Nick Mathewson 33200e72 2010-08-10T15:03:14 Document that DNS_NO_SEARCH is an obsolete alias for DNS_QUERY_NO_SEARCH
Nick Mathewson 3808168d 2010-08-10T15:02:50 Completely remove the (mostly-removed) obsolete thread functions.
Nick Mathewson 9b5c19ac 2010-08-10T11:46:00 Merge branch 'more_pkgconfig'
Nick Mathewson ebcb1f03 2010-08-10T11:11:25 Add pkgconfig files for libevent_{openssl,pthreads}
Nick Mathewson 0bffe43a 2010-08-09T12:08:40 Fix a nasty dangling-event bug when using rate-limiting groups When we freed a bufferevent that was in a rate-limiting group and blocked on IO, the process of freeing it caused it to get removed from the group. But removing the bufferevent from the group made its limits get removed, which could make it get un-suspended and in turn cause its events to get re-added. Since we would then immediately _free_ the events, this would result in dangling pointers. Fixes bug 3041007.
Nick Mathewson ff481a8e 2010-08-06T23:22:01 Increment vesion to 2.0.6-rc-dev
Nick Mathewson 556d0f40 2010-08-06T21:19:44 Increment versions to 2.0.6-rc
Nick Mathewson f6582640 2010-08-06T21:11:01 Changlog and new acknowledgements for 2.0.6-rc
Nick Mathewson ec347b92 2010-07-07T16: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.
Nick Mathewson 5fa30d2b 2010-08-06T17:13:27 Fix evdns build with -DUNICODE It turns out that GetProcAddress always takes its second argument as a C string, regardless of whether unicode is on or not.
Nick Mathewson 28f31a4f 2010-08-06T16:36:23 Fix unit tests with -DUSE_DEBUG enabled If you were to enable USE_DEBUG and slog through all 700+ MB of debugging output, you'd find that one of the unit tests failed, since it tested the debug logging code, but the string it expected and the string it logged differed by a tab vs 2 spaces.
Nick Mathewson ea1ea3d6 2010-08-06T13:34:51 Make test-changelist count cpu usage right on win32
Nick Mathewson 9b602096 2010-08-06T13:03:17 Use AF_INET socketpair to test sendfile on Solaris
Nick Mathewson 57b30cd7 2010-08-06T13:01:32 Turn our socketpair() replacement into its own function This patch splits the formerly windows-only case of evutil_socketpair() into an (internal-use-only) function named evutil_ersatz_socketpair(), and makes it build and work right on non-Windows hosts. We need this for convenience to test sendfile on solaris, where socketpair can't give you an AF_INET pair, and sendfile() won't work on AF_UNIX.
Christopher Davis de1f5d6d 2010-08-06T09:33:55 Remember to initialize timeout events for bufferevent_async Fixes segfaults in unit tests.