Log

Author Commit Date CI Message
Nick Mathewson 066775e3 2012-02-28T13:09:51 Fix evmap to work with HT-backed IO maps again.
Nick Mathewson ca47fa0b 2012-02-28T12:53:46 evutil_accept4() should take ev_socklen_t
Nick Mathewson d7d9f755 2012-02-27T18:10:45 test-fdleak: Avoid perror, since it does not capture windows socket errors
Nick Mathewson 510839e7 2012-02-27T18:08:27 remove debugging prints
Nick Mathewson d9be5f49 2012-02-27T18:06:28 test-fdleak: Call event callbacks event_cb.
Nick Mathewson 077c7e94 2012-02-27T18:05:49 Remove fixed port from test-fdleak, so two instances can run in parallel
Nick Mathewson c9ba53a3 2012-02-27T17:57:01 Remove an unsafe programming practice from test-fdleak; add XX comments It's a bad idea to have a read callback read a fixed amount; Instead, we should drain it, or have some way to know that more data is arrived. Not unsafe in this case, but let's not encourage people to learn bad habits. This commit also notes some other stuff to fix.
Ross Lagerwall 4293a809 2012-02-25T07:47:49 Try and fix compilation and running of test-fdleak on Windows.
Ross Lagerwall 1c4288f4 2012-02-25T07:36:49 Allow compilation on machines that do not have setrlimit.
Ross Lagerwall f7af1941 2012-02-25T07:21:20 Simply test-fdleak by running server & client sockets in the same event loop.
Ross Lagerwall 2ef92786 2012-02-23T21:40:02 Add a new test: test-fdleak which tests for fd leaks by creating many sockets. This test opens a server socket, and forks a child which connects to that server socket many times. It sets a low number for the max open file limit to catch any file descriptor leaks. It would not work on Windows since it uses fork() to be able to create both the server and the clients.
Nick Mathewson 74d32dd4 2012-02-21T20:39:17 If accept4 is absent, fall back to accept.
Nick Mathewson a6492cb7 2012-02-21T20:38:36 Avoid leaking fd in evutil_socket() by Linux. Found by Amarin Phaosawasdi
Nick Mathewson a3cec909 2012-02-20T14:07:08 Remove the last vestiges of _EVENT_USE_EVENTLIST
Nick Mathewson 8dbcf8d6 2012-02-20T13:56:13 Merge branch '21_eventlist_v3_squashed'
Nick Mathewson cad57535 2012-02-11T21:05:50 Add doxygen for event_base_dump_events
Nick Mathewson c89b4e63 2012-02-11T21:01:53 Refactor the functions that run over every event. Now there are appropriate "for each event", "for each fd", and "for each signal" helpers that they can use; this makes the code a bit simpler, and far less duplicated. This lets me turn back on the functions I disabled when removing eventlist. Additionally, check more lists for circularity in event_base_assert_ok(). Add typedefs for the callback types. Name fewer things "ctx". Adds an implementation of Floyd's tortoise-and-hare algorithm to check for circularity in TAILQs and LISTs, to avoid the abuse of flags that event_base_assert_ok() was doing before. Suggested by Dave Hart.
Nick Mathewson 65bc91c2 2012-02-17T10:42:56 Fix an "unused return value" warning on write() in signal handler
Nick Mathewson 819e98ac 2012-02-16T01:21:42 Start work on a 2.1 changelog and whats-new
Nick Mathewson a270728e 2012-02-15T21:27:52 Add another caveat to the TCP_DEFER_ACCEPT documentation
Mark Ellzey 5880e4a1 2012-02-14T18:04:52 Support TCP_DEFER_ACCEPT sockopts for listeners A listening socket can be enabled with the sockopt TCP_DEFER_ACCEPT. This informs the kernel to not call the user-land accept() until real data has been written to the socket. A new flag LEV_OPT_DEFERRED_ACCEPT has been introduced to automatically set this option. Optionally evutil_make_tcp_listen_socket_deferred() can be called manually. (Tweaked slightly by nickm.)
Nick Mathewson a220a081 2012-02-15T21:07:44 Merge remote-tracking branch 'github/21_fast_syscalls'
Nick Mathewson a63ed161 2012-02-15T20:26:52 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson bec50680 2012-02-15T20:12:32 Stop crashing in evdns when nameserver probes give a weird error When a nameserver is down, we periodically try sending a "probe" message to that nameserver to see if it has come back up. If a nameserver comes up, we cancel any pending probe messages. Cancelling a probe message while handling the probe's response would result in a access-after-free or a double-free, so when we notice that we're about to call a nameserver up because of having received a probe from it, we need to check whether current response is the response from the probe. There was a case where we didn't to that, though: when the resolver gave us an unusual error response to our request that it resolve google.com. This is pretty rare, but apparently it can happen with some weird cacheing nameservers -- the one on the mikrotik router, for example. Without this patch, we would crash with a NULL pointer derefernce. Thanks to Hannes Sowa for finding this issue and helping me track it down.
Nick Mathewson a37cbfda 2012-02-14T15:44:03 Merge remote-tracking branch 'origin/patches-2.0' Conflicts: configure.in
Mark Ellzey 2d67b638 2012-02-14T15:37:58 Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD
Mark Ellzey 92781968 2012-02-14T15:01:02 Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. If openssl is not installed system-wide or not compiled as a shared library, some systems require various link flags (e.g., -ld).
Nick Mathewson 2ed44302 2012-02-14T11:48:55 If open(O_CLOEXEC) fails, fall back to fcntl(CLOEXEC) This is needed for folks who build with recent Linux kernel headers but run with older kernels.
Nick Mathewson f088d0c5 2012-02-13T18:34:00 Fix up usage of reserved identifiers in ht-internal.h
Nick Mathewson 4900c5f9 2012-02-13T18:04:05 Port changes from Tor for ht-internal.h
Nick Mathewson 46e5bb7b 2012-02-13T17:59:14 Invert the sense and the name of HT_CACHE_HASH_VALUES This is meant to make it easier to merge ht-internal.h back upstream into Tor.
Nick Mathewson 6c81be74 2012-02-13T17:49:17 Synchronize with upstream tinytest
Nick Mathewson a9dc063c 2012-02-13T17:30:46 Merge in a punctuation fix from upstream tinytest
Nick Mathewson bbea8d6b 2012-02-13T12:19:08 Move libevent 1.x headers to include/, to put all public headers in one place.
Nick Mathewson 27931976 2012-02-11T21:20:47 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 03dce42d 2012-02-11T21:17:18 Tweak the evutil_open_closeonexec patch to work on windows, old unixes. Windows doesn't have a mode_t as far as I can tell. Some unixes, iirc, don't like three-argument open without O_CREAT.
Ross Lagerwall d2b5f722 2012-02-11T17:23:17 Make uses of open() close-on-exec safe by introducing evutil_open_closeonexec. In a multi-process/threaded environment, opening fds internally without the close-on-exec flag could leak fds to child processes.
Nick Mathewson a6503944 2012-02-11T12:04:15 Add a bufferevent_getcb() to find a bufferevent's current callbacks
Nick Mathewson bf2c5a77 2012-02-10T23:56:49 Also make win32select.c conditional for IDE users
Nick Mathewson 87a7cded 2012-02-10T23:52:27 Merge branch 'ifdef' of git://github.com/rosslagerwall/libevent
Nick Mathewson de69eb7b 2012-02-10T23:51:11 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 0c483170 2012-02-10T22:20:05 Add an empty section to the changelog for 2.0.18-stable
Nick Mathewson c5b6e464 2012-02-10T22:18:19 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 5a807b7a 2012-02-10T22:17:59 Correct a name in the credits. oops
Nick Mathewson 8fd7a243 2012-02-10T22:16:46 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 2d7bf0f7 2012-02-10T22:16:14 Bump version to 2.0.17-stable-dev
Nick Mathewson 2d915460 2012-02-10T18:50:17 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 83e58ccd 2012-02-10T18:39:31 Update the credits in the readme
Nick Mathewson 0cdbd642 2012-02-10T18:36:10 Finalize the changelog
Nick Mathewson 2b0a2c45 2012-02-10T18:04:04 Fix compilation on osx
Nick Mathewson 539466e5 2012-02-10T17:33:50 Merge remote-tracking branch 'origin/patches-2.0' Conflicts: Makefile.am WIN32-Code/event2/event-config.h configure.in
Nick Mathewson e49e2891 2012-02-10T17:29:53 Update copyright notices to 2012
Nick Mathewson 8152b4c2 2012-02-10T16:49:05 Bump version to 2.0.17-stable
Nick Mathewson bac906c7 2012-02-10T16:39:46 Prefer epoll_create1 on Linuxen that have it
Nick Mathewson 33fca629 2012-02-10T16:33:25 Save some syscalls when constructing a socket for a bufferevent
Nick Mathewson 713e570a 2012-02-10T16:32:50 Save some syscalls when creating evdns sockets
Nick Mathewson af6c9d8e 2012-02-10T16:32:32 Save syscalls when constructing listener sockets for evhttp
Nick Mathewson a35f396f 2012-02-10T16:25:53 Use pipes for telling signals to main thread when possible
Nick Mathewson ca76cd93 2012-02-10T16:15:10 Use a wrapper function to create the notification pipe/socketpair/eventfd
Nick Mathewson 4970329a 2012-02-10T16:14:09 The LEV_OPT_CLOSE_ON_EXEC flag now applies to accepted listener sockets too
Nick Mathewson 7e9e2893 2012-02-10T16:13:30 Minimize syscalls during socket creation in listener.c
Nick Mathewson a1c042bf 2012-02-10T15:55:15 Infrastructure for using faster/fewer syscalls when creating sockets Linux provides some features that allow avoiding extra calls to fcntl when creating new nonblocking/close-on-exec sockets, so we can add wrapper functions to emulate those when they are not available. Additionally, even when we are emulating those functions, we can take a fast path that cuts our fcntl calls in half: we don't need to look up the previous value of a file's flags when we have just created it.
Nick Mathewson e465623a 2012-02-10T12:05:39 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 5d7bfa15 2012-02-10T11:24:51 In the kqueue backend, do not report EBADF as an EV_READ We were doing this because of (correct) reports that NetBSD gives an EBADF when you try to add the write side of a pipe for which the read side has been closed. But on most kqueue platforms, that doesn't happen, and on *all* kqueue platforms, reporting a nonexistent fd (which we usually have if we have seen EBADF) as readable tends to give programs a case of the vapors. Nicholas Marriott wrote the original patch here; I did the comment fixes.
Nick Mathewson df19ba6a 2012-02-09T15:16:02 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 19715a60 2012-02-09T15:07:19 Avoid crash when freeing event_iocp and using event_set_mem_functions There was a calloc that needed to be an mm_calloc. Reported by "fffvvvzz" on sourceforge. Ticket 3486114
Ross Lagerwall 76d4c929 2012-02-08T18:46:00 Put #ifdef around some files to support alternate build systems.
Nick Mathewson 6f6cebe3 2012-02-06T21:18:25 Bring the changelog up to date
Nick Mathewson c00416f7 2012-02-06T12:39:09 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 5b4b8126 2012-02-06T12:24:49 Loop on filtering SSL reads until we are blocked or exhausted. This is not a perfect fix, but it's much much better than the current buggy behavior, which could lead to filtering SSL connections that just stopped reading. Based on ideas by Maseeb Abdul Qadir and Mark Ellzey.
Nick Mathewson 4dee4cc7 2012-02-02T11:45:23 Replace more C99/C++ comments with oldschool /* */ comments
Nick Mathewson 7c46d4aa 2012-02-02T11:41:37 Merge remote-tracking branch 'origin/patches-2.0'
Greg Hewgill d84d9170 2011-11-21T09:41:55 Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX).
Nick Mathewson 032aac15 2012-02-01T14:57:44 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson d6094b16 2012-02-01T14:56:43 evdns: fix a bug in circular-queue implementation found by Wang Qin
Sebastian Hahn e4a56ed5 2012-01-31T18:58:59 Fix a compile warning in event_reinit Introduced in 272033efe575a9dc7ec6f123a96afba5c69ff1c6
Nick Mathewson 604569bf 2012-01-27T16:35:04 Remove the eventqueue list and the ev_next pointers. Those pointers were once used to maintain a complete list of inserted IO and signal events. But such a list is now available by walking over ev_io_map and ev_signal_map! So all they did was require extra pointer operations to maintain, and extra 8-16 bytes of storage in each struct event. To be cowardly and keep the option of going back to having this redundancy, I'm wrapping the removed code in a set of ifdefs. This is a first cut; it needs cleanups and stress-testing!! In particular, it just plain disables a couple of functions that could probably be saved. There seems to be a need for an evmap_{io,signal}_foreach() or something.
Nick Mathewson 7622d265 2012-01-27T15:10:28 Make test-changelist faster
Nick Mathewson 39b3f38d 2012-01-27T14:39:18 Check changelist as part of checking representational integrity
Nick Mathewson 2c4b5de1 2012-01-27T14:30:41 Restore fast-path event_reinit() for slower backends We used to use the needs_reinit flag in struct eventop to indicate whether an event backend had shared state across a fork(), and therefore would require us to construct a new event backend. But when we realized that the signal notification fds and the thread notification fds would always be shared across forks, we stopped looking at it. This patch restores the old behavior so that poll, select, and win32select don't need to do a linear scan over all pending fds/signals when they do a reinit. Their life is hard enough already.
Nick Mathewson 272033ef 2012-01-27T13:54:05 Make event_reinit() more robust and maintainable Previously, event_reinit required a bunch of really dubious hacks, and violated a lot of abstraction barriers to mess around with lists of internal events and "pretend" to re-add them. The new (and fairly well commented!) implementation tries to be much smarter, by isolating the changes as much as possible to the backend state, and minimizing the amount of abstraction violations. Specifically, we now use event_del() to remove events we want to remove, rather than futzing around with queues in event_reinit(). To avoid bogus calls to evsel->del(), we temporarily replace evsel with a null-object stub. Also, we now push the responsibility for calling evsel->add() down into the evmap code, so that we don't actually need to unlink and re-link all of our events.
Nick Mathewson 4b7baec6 2012-01-26T16:56:33 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 9f9e259f 2012-01-26T15:04:24 Better workaround for Linux 3.2 edge-triggered epoll bug On further investigation, it appears that this problem is limited to AF_UNIX sockets, so let's just do the test on AF_INET sockets.
Nick Mathewson 2c6b3246 2012-01-24T17:18:52 Merge remote-tracking branch 'origin/patches-2.0'
Nate R c94a5f2a 2012-01-24T17:15:50 Do a memberwise comparison of threading function tables Doing a memcmp risks comparing uninitialized padding bytes at the end of the structure.
Nick Mathewson 95e2455c 2012-01-24T16:08:00 When including an -internal.h header outside the main tree, do so early Some of our unit tests and sample code need functions and structures defined in an -internal.h header. But that can freak out OpenSolaris, where stdio.h wants to define _FILE_OFFSET_BITS unless it's already defined, and then evconfig-internal.h defines it. Regular users should never ever use our -internal.h headers, so the solution is to make sure that if we're going to use them ourselves, we do so before system headers.
Nick Mathewson b9f7e5fd 2012-01-24T15:58:11 Allow more slop in deferred_cb_skew test; freebsd needs it
Nick Mathewson ea30a435 2012-01-24T15:30:51 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 3aa0e8a9 2012-01-24T15:30:31 Remove a couple of now-unused variables
Nick Mathewson 438d4ff2 2012-01-24T15:29:39 Make event_base integrity check work on windows
Nick Mathewson edc6d7d7 2012-01-24T15:09:04 Start writing a changelog for 2.0.17-stable
Nick Mathewson b77b43fc 2012-01-24T14:59:37 Use test_timeval_diff_eq more consistently
Nick Mathewson 67a1763b 2012-01-24T14:33:10 Make regression tests run over 3x faster. This was mainly a matter of reducing timeouts and delays, paying special attention to every test that took longer than a second to finish. We could do better here; IMO anything over .7 sec is probably too long, but it's a big win as it is. Remember, interactive computing is a big win over batch processing: anything that makes you get up and walk away from the terminal might as well be making you carry your punch cards over to the mainframe.
Nick Mathewson 350a3c40 2012-01-24T14:34:04 New evhttp function to adjust initial retry timeout
Nick Mathewson ab14f7c1 2012-01-24T11:45:00 Reduce the timeout in the main/fork test. There was no reason for it to be so long, except for the lack of a usleep
Nick Mathewson f25d9d32 2012-01-24T11:42:26 Add an (internal) usleep function for use by unit tests
Nick Mathewson 18653fca 2012-01-24T11:17:06 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson 5408ff3b 2012-01-24T11:16:26 Oops:remove an accidentally committed "sleep(1)" in a unit test
Nick Mathewson 10996a1a 2012-01-24T11:04:56 Merge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson dab91877 2012-01-24T11:04:19 Workaround in the unit tests for an apparent epoll bug in Linux 3.2