1*2dedff36SNick MathewsonChanges in version 2.1.1-alpha (4 Apr 2012) 225a424fbSNick Mathewson 3*2dedff36SNick Mathewson Libevent 2.1.1-alpha includes a number of new features and performance 4*2dedff36SNick Mathewson improvements. The log below tries to organize them by rough area of 5*2dedff36SNick Mathewson effect. It omits some commits which were pure bugfixes on other commits 6*2dedff36SNick Mathewson listed below. For more detail, see the git changelogs. For more 7*2dedff36SNick Mathewson insight, see the "whatsnew-2.1.txt" document included in the Libevent 8*2dedff36SNick Mathewson 2.1.1-alpha distribution. 925a424fbSNick Mathewson 10*2dedff36SNick Mathewson Performance: Core 11*2dedff36SNick Mathewson o Replace several TAILQ users with LIST. LIST can be a little faster than 12*2dedff36SNick Mathewson TAILQ for cases where we don't need queue-like behavior. (f9db33d, 13*2dedff36SNick Mathewson 6494772, d313c29, 974d004) 14*2dedff36SNick Mathewson o Disabled code to optimize the case where we reinsert an existing 15*2dedff36SNick Mathewson timeout (e47042f, 09cbc3d) 16*2dedff36SNick Mathewson o Remove a needless base-notify when rescheduling the first timeout (77a96fd) 17*2dedff36SNick Mathewson o Save a needless comparison when removing/adjusting timeouts (dd5189b) 18*2dedff36SNick Mathewson o Possible optimization: split event_queue_insert/remove into 19*2dedff36SNick Mathewson separate functions. needs testing (efc4dc5) 20*2dedff36SNick Mathewson o Make event_count maintainance branchless at the expense of an 21*2dedff36SNick Mathewson extra shift. Needs benchmarking (d1cee3b) 22*2dedff36SNick Mathewson o In the 2.1 branch, let's try out lazy gettimeofday/clock_gettime 23*2dedff36SNick Mathewson comparison (2a83ecc) 24*2dedff36SNick Mathewson o Optimization in event_process_active(): ignore maxcb & endtime 25*2dedff36SNick Mathewson for highest priority events. (a9866aa Alexander Drozdov) 26*2dedff36SNick Mathewson o Bypass event_add when using event_base_once() for a 0-sec timeout (35c5c95) 27*2dedff36SNick Mathewson o Remove the eventqueue list and the ev_next pointers. (604569b 066775e) 2877342926SNick Mathewson 29*2dedff36SNick Mathewson Performance: Evbuffers 30*2dedff36SNick Mathewson o Roughly 20% speed increase when line-draining a buffer using 31*2dedff36SNick Mathewson EVBUFFER_EOL_CRLF (5dde0f0 Mina Naguib) 32*2dedff36SNick Mathewson o Try to squeeze a little more speed out of EVBUFFER_EOL_CRLF (7b9d139) 33*2dedff36SNick Mathewson o Fix a bug in the improved EOL_CRLF code (d927965) 34*2dedff36SNick Mathewson o Remove a needless branch in evbuffer_drain() (d19a326) 3577342926SNick Mathewson 36*2dedff36SNick Mathewson Performance: Linux 37*2dedff36SNick Mathewson o Infrastructure for using faster/fewer syscalls when creating 38*2dedff36SNick Mathewson sockets (a1c042b) 39*2dedff36SNick Mathewson o Minimize syscalls during socket creation in listener.c (7e9e289) 40*2dedff36SNick Mathewson o Use a wrapper function to create the notification 41*2dedff36SNick Mathewson pipe/socketpair/eventfd (ca76cd9) 42*2dedff36SNick Mathewson o Use pipes for telling signals to main thread when possible (a35f396) 43*2dedff36SNick Mathewson o Save syscalls when constructing listener sockets for evhttp (af6c9d8) 44*2dedff36SNick Mathewson o Save some syscalls when creating evdns sockets (713e570) 45*2dedff36SNick Mathewson o Save some syscalls when constructing a socket for a bufferevent (33fca62) 46*2dedff36SNick Mathewson o Prefer epoll_create1 on Linuxen that have it (bac906c) 4777342926SNick Mathewson 48*2dedff36SNick Mathewson Performance: Epoll backend 49*2dedff36SNick Mathewson o Use current event set rather than current pending change when 50*2dedff36SNick Mathewson deciding whether to no-op a del (04ba27e Mike Smellie) 51*2dedff36SNick Mathewson o Replace big chain of if/thens in epoll.c with a table lookup (8c83eb6) 52*2dedff36SNick Mathewson o Clean up error handling in epoll_apply_one_change() a little (2d55a19) 5377342926SNick Mathewson 54*2dedff36SNick Mathewson Performance: Evport backend 55*2dedff36SNick Mathewson o evport: use evmap_io to track fdinfo status. Should save time and 56*2dedff36SNick Mathewson RAM. (4687ce4) 57*2dedff36SNick Mathewson o evport: Remove a linear search over recent events when 58*2dedff36SNick Mathewson reactivating them (0f77efe) 59*2dedff36SNick Mathewson o evport: Use portev_user to remember fdinfo struct (276ec0e) 60*2dedff36SNick Mathewson o evport: don't scan more events in ed_pending than needed (849a5cf) 61*2dedff36SNick Mathewson o evport: Remove artificial low limit on max events per getn call (c04d927) 62*2dedff36SNick Mathewson o Reenable main/many_events_slow_add for evport in 2.1 (e903db3) 630c483170SNick Mathewson 64*2dedff36SNick Mathewson Performance: Windows 65*2dedff36SNick Mathewson o Use GetSystemTimeAsFileTime to implement gettimeofday on 66*2dedff36SNick Mathewson win32. It's faster and more accurate than our old 67*2dedff36SNick Mathewson approach. (b8b8aa5) 68edc6d7d7SNick Mathewson 69*2dedff36SNick Mathewson New functions and features: debugging 70*2dedff36SNick Mathewson o Add event_enable_debug_logging() to control use of debug logs (e30a82f) 71edc6d7d7SNick Mathewson 72*2dedff36SNick Mathewson New functions and features: core 73*2dedff36SNick Mathewson o Add event_config function to limit time/callbacks between calls 74*2dedff36SNick Mathewson to dispatch (fd4de1e, 9fa56bd, a37a0c0, 3c63edd) 75*2dedff36SNick Mathewson o New EVLOOP_NO_EXIT_ON_EMPTY option to keep looping even when no 76*2dedff36SNick Mathewson events are pending (084e68f) 77*2dedff36SNick Mathewson o Add event_base_get_npriorities() function. (ee3a4ee Alexander Drozdov) 78*2dedff36SNick Mathewson o Make evbase_priority_init() and evbase_get_npriorities() 79*2dedff36SNick Mathewson threadsafe (3c55b5e) 80*2dedff36SNick Mathewson o New event_base_update_cache_time() to set cached_tv to current 81*2dedff36SNick Mathewson time (212533e Abel Mathew) 82*2dedff36SNick Mathewson o Add event_self_cbarg() to be used in conjunction with 83*2dedff36SNick Mathewson event_new(). (ed36e6a Ross Lagerwall, fa931bb, 09a1906, 1338e6c, 84*2dedff36SNick Mathewson 33e43ef) 85*2dedff36SNick Mathewson o Add a new libevent_global_shutdown() to free all globals before 86*2dedff36SNick Mathewson exiting. (041ca00 Mark Ellzey, f98c158, 15296d0, 55e991b) 87*2dedff36SNick Mathewson o Use getifaddrs to detect our interfaces if possible (7085a45) 88*2dedff36SNick Mathewson o Add event_base_get_running_event() to get the event* whose cb we 89*2dedff36SNick Mathewson are in (c5732fd, 13dad99) 90edc6d7d7SNick Mathewson 91*2dedff36SNick Mathewson New functions and features: building 92*2dedff36SNick Mathewson o Implement --enable-gcc-hardening configure option (7550267 Sebastian Hahn) 93edc6d7d7SNick Mathewson 94*2dedff36SNick Mathewson New functions and features: evbuffers 95*2dedff36SNick Mathewson o Add evbuffer_add_file_segment() so one fd can be used efficiently 96*2dedff36SNick Mathewson in more than one evbuffer_add_file at a time (e72afae, c2d9884, 97*2dedff36SNick Mathewson 3f405d2, 0aad014) 98*2dedff36SNick Mathewson o Fix windows file segment mappings (8254de7) 99*2dedff36SNick Mathewson o Allow evbuffer_ptr_set to yield a point just after the end of the 100*2dedff36SNick Mathewson buffer. (e6fe1da) 101*2dedff36SNick Mathewson o Allow evbuffer_ptr to point to position 0 in an empty evbuffer 102*2dedff36SNick Mathewson (7aeb2fd Nir Soffer) 103*2dedff36SNick Mathewson o Set the special "not found" evbuffer_ptr consistantly. (e3e97ae Nir Soffer) 104*2dedff36SNick Mathewson o support adding buffers to other buffers non-destructively 105*2dedff36SNick Mathewson (9d7368a Joachim Bauch) 106*2dedff36SNick Mathewson o prevent nested multicast references, reworked locking (26041a8 107*2dedff36SNick Mathewson Joachim Bauch) 108*2dedff36SNick Mathewson o New EVBUFFER_EOL_NUL to read NUL-terminated strings from an 109*2dedff36SNick Mathewson evbuffer (d7a8b36 Andrea Montefusco, 54142c9) 110*2dedff36SNick Mathewson o Make evbuffer_file_segment_types adaptable (c6bbbf1) 111*2dedff36SNick Mathewson o Added evbuffer_add_iovec and unit tests. (aaec5ac Mark Ellzey, 27b5398) 112*2dedff36SNick Mathewson o Add evbuffer_copyout_from to copy data from the middle of a 113*2dedff36SNick Mathewson buffer (27e2225) 1146f6cebe3SNick Mathewson 115*2dedff36SNick Mathewson New functions and features: bufferevents 116*2dedff36SNick Mathewson o Allow users to set allow_dirty_shutdown (099d27d Catalin Patulea) 117*2dedff36SNick Mathewson o Tweak allow_dirty_shutdown documentation (a44cd2b) 118*2dedff36SNick Mathewson o Fix two issues in the allow_dirty_shutdown code. (f3b89de) 119*2dedff36SNick Mathewson o Add a bufferevent_getcb() to find a bufferevent's current 120*2dedff36SNick Mathewson callbacks (a650394) 121*2dedff36SNick Mathewson o bufferevent: Add functions to set/get max_single_read/write 122*2dedff36SNick Mathewson values. (998c813 Alexander Drozdov) 123*2dedff36SNick Mathewson o bev_ssl: Be more specific in event callbacks. evhttp in particular gets 124*2dedff36SNick Mathewson confused without at least one of BEV_EVENT_{READING|WRITING}. (f7eb69a 125*2dedff36SNick Mathewson Catalin Patulea) 126edc6d7d7SNick Mathewson 127*2dedff36SNick Mathewson New functions and features: evconnlisteners 128*2dedff36SNick Mathewson o Support TCP_DEFER_ACCEPT sockopts for listeners (5880e4a Mark Ellzey, 129*2dedff36SNick Mathewson a270728) 130*2dedff36SNick Mathewson o Add another caveat to the TCP_DEFER_ACCEPT documentation (a270728) 131*2dedff36SNick Mathewson o Allow evconnlistener to be created in disabled state. (9593a33 132*2dedff36SNick Mathewson Alexander Drozdov) 133*2dedff36SNick Mathewson o The LEV_OPT_CLOSE_ON_EXEC flag now applies to accepted listener 134*2dedff36SNick Mathewson sockets too (4970329) 135edc6d7d7SNick Mathewson 136*2dedff36SNick Mathewson Evhttp: 137*2dedff36SNick Mathewson o Add new evhttp_{connection_}set_timeout_tv() functions to set 138*2dedff36SNick Mathewson finger-grained http timeouts (6350e6c Constantine Verutin) 139*2dedff36SNick Mathewson o Performance tweak to evhttp_parse_request_line. (aee1a97 Mark Ellzey) 140*2dedff36SNick Mathewson o Add missing break to evhttp_parse_request_line (0fcc536) 141*2dedff36SNick Mathewson o Add evhttp callback for bufferevent creation; this lets evhttp 142*2dedff36SNick Mathewson support SSL. (8d3a850) 143*2dedff36SNick Mathewson o Remove calls to deprecated bufferevent functions from evhttp.c (4d63758) 144*2dedff36SNick Mathewson o evhttp: Add evhttp_foreach_bound_socket. (a2c48e3 Samy Al Bahra) 145edc6d7d7SNick Mathewson 146*2dedff36SNick Mathewson Build improvements: 147*2dedff36SNick Mathewson o Add AC_USE_SYSTEM_EXTENSIONS to configure.in. Requires follow on 148*2dedff36SNick Mathewson patches for correctness and robustness. (1fa7dbe Kevin Bowling) 149*2dedff36SNick Mathewson o Filter '# define' statements from autoconf and generate 150*2dedff36SNick Mathewson event-private.h (321b558 Kevin Bowling) 151*2dedff36SNick Mathewson o Remove internal usage of _GNU_SOURCE (3b26541 Kevin Bowling) 152*2dedff36SNick Mathewson o Eliminate a couple more manual internal _GNU_SOURCE defines (c51ef93 153*2dedff36SNick Mathewson Kevin Bowling) 154*2dedff36SNick Mathewson o Add AC_GNU_SOURCE to the fallback case. (ea8fa4c Kevin Bowling) 155*2dedff36SNick Mathewson o Use a Configuration Header Template for evconfig-private.h (868f888 156*2dedff36SNick Mathewson Kevin Bowling) 157*2dedff36SNick Mathewson o Fix a comment warning and add evconfig-private.h to .gitignore 158*2dedff36SNick Mathewson (f6d66bc Kevin Bowling) 159*2dedff36SNick Mathewson o Include evconfig-private.h in internal files for great good. (0915ca0 160*2dedff36SNick Mathewson Kevin Bowling) 161*2dedff36SNick Mathewson o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) 162*2dedff36SNick Mathewson (ad03952 Kevin Bowling) 163*2dedff36SNick Mathewson o Prefer the ./configure evconfig-private.h in MinGW, just in 164*2dedff36SNick Mathewson case. (f964b72 Kevin Bowling) 165*2dedff36SNick Mathewson o Shell hack for weird mkdir -p commands (fd7b5a8 Kevin Bowling) 166*2dedff36SNick Mathewson o Add evconfig-private to remaining files (ded0a09 Kevin Bowling) 167*2dedff36SNick Mathewson o Allow use of --enable-silent-rules for quieter compilation with 168*2dedff36SNick Mathewson automake 1.11 (f1f8514 Dave Hart) 169*2dedff36SNick Mathewson o Use "_WIN32", not WIN32: it's standard and we don't need to fake it 170*2dedff36SNick Mathewson (9f560b) 171*2dedff36SNick Mathewson o In configure, test for _WIN32 not WIN32. (85078b1 Peter Rosin) 172*2dedff36SNick Mathewson o Do not define WIN32 in Makefile.nmake (d41f3ea Peter Rosin) 173*2dedff36SNick Mathewson o Provide the autoconf m4 macros for the new OpenSSL via pkg-config 174*2dedff36SNick Mathewson stuff. (674dc3d Harlan Stenn) 175*2dedff36SNick Mathewson o Use pkg-config (if available) to handle OpenSSL. (1c63860 Harlan Stenn) 176*2dedff36SNick Mathewson o We need AM_CPPFLAGS when compiling bufferevent_openssl.c (6d2613b 177*2dedff36SNick Mathewson Harlan Stenn) 178*2dedff36SNick Mathewson o Fix OSX build: $(OPENSSL_INCS) needs to be after 179*2dedff36SNick Mathewson $(AM_CPPFLAGS). (46f1769 Zack Weinberg) 180*2dedff36SNick Mathewson o Make gcc warnings on by default, and --enable-gcc-warnings only add 181*2dedff36SNick Mathewson -Werror (d46517e Sebastian Hahn) 182*2dedff36SNick Mathewson o Split up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in (88a30ad) 183*2dedff36SNick Mathewson o Move libevent 1.x headers to include/, to put all public headers in 184*2dedff36SNick Mathewson one place. (bbea8d6) 185*2dedff36SNick Mathewson o Put #ifdef around some files to support alternate build 186*2dedff36SNick Mathewson systems. (76d4c92 Ross Lagerwall) 187*2dedff36SNick Mathewson o Also make win32select.c conditional for IDE users (bf2c5a7) 188edc6d7d7SNick Mathewson 189*2dedff36SNick Mathewson Debugging: 190*2dedff36SNick Mathewson o Add a magic number to debug_locks to better catch lock-coding 191*2dedff36SNick Mathewson errors. (b4a29c0 Dave Hart) 192*2dedff36SNick Mathewson o munge the debug_lock signature before freeing it: it might help us 193*2dedff36SNick Mathewson catch use-after-free (f28084d) 194*2dedff36SNick Mathewson o Added --enable-event-debugging in configure (bc7b4e4, a9c2c9a Mark Ellzey) 195*2dedff36SNick Mathewson o Debug addition for printing usec on TIMEOUT debugging. (ac43ce0 Mark Ellzey) 196*2dedff36SNick Mathewson o Added usec debug in another area for debug (3baab0d Mark Ellzey) 197*2dedff36SNick Mathewson o added timeout debug logs to include event ptr. (4b7d298 Mark Ellzey) 198*2dedff36SNick Mathewson o more event dbg updates (6727543 Mark Ellzey) 199*2dedff36SNick Mathewson o Clarify event_enable_debug_logging a little (6207826) 200*2dedff36SNick Mathewson o Make --enable-verbose-debug option match its help text (10c3450) 201*2dedff36SNick Mathewson o Add argument checks to some memory functions in `event.c'. (c8953d1 202*2dedff36SNick Mathewson Mansour Moufid) 20334045c8fSNick Mathewson 204*2dedff36SNick Mathewson Testing: 205*2dedff36SNick Mathewson o More abstraction in test.sh (cd74c4e) 206*2dedff36SNick Mathewson o Add failing test for evbuffer_search_range. (8e26154 Nir Soffer) 207*2dedff36SNick Mathewson o Tweaks to return types with end-of-buf ptrs (9ab8ab8) 208*2dedff36SNick Mathewson o Add an (internal) usleep function for use by unit tests (f25d9d3) 209*2dedff36SNick Mathewson o Synchronize with upstream tinytest (6c81be7) 210*2dedff36SNick Mathewson o Make test-changelist faster (7622d26) 211*2dedff36SNick Mathewson o Reduce the timeout in the main/fork test. (ab14f7c) 212*2dedff36SNick Mathewson o New evhttp function to adjust initial retry timeout (350a3c4) 213*2dedff36SNick Mathewson o Make regression tests run over 3x faster. (67a1763) 214*2dedff36SNick Mathewson o Use test_timeval_diff_eq more consistently (b77b43f) 215*2dedff36SNick Mathewson o Allow more slop in deferred_cb_skew test; freebsd needs it (b9f7e5f) 216*2dedff36SNick Mathewson o When including an -internal.h header outside the main tree, do so 217*2dedff36SNick Mathewson early (95e2455) 218*2dedff36SNick Mathewson o Add a new test: test-fdleak which tests for fd leaks by creating many 219*2dedff36SNick Mathewson sockets. (2ef9278 Ross Lagerwall, f7af194, 1c4288f, etc) 220*2dedff36SNick Mathewson o Add a unit test for event_base_dump_events() (7afe48a, 8d08cce) 221*2dedff36SNick Mathewson o Test more bufferevent_ratelim features (c24f91a) 22234045c8fSNick Mathewson 223*2dedff36SNick Mathewson Documentation: 224*2dedff36SNick Mathewson o Improve evbuffer_ptr documentation (261ba63) 225*2dedff36SNick Mathewson o added comments to describe refcounting of multicase chains (ba24f61 226*2dedff36SNick Mathewson Joachim Bauch) 227*2dedff36SNick Mathewson o Add doxygen for event_base_dump_events (cad5753) 22831c99bd2SNick Mathewson 229*2dedff36SNick Mathewson OSX: 230*2dedff36SNick Mathewson o Use "unlimited select" on OSX so that we can have more than 231*2dedff36SNick Mathewson FD_SETSIZE fds (1fb5cc6) 23234045c8fSNick Mathewson 233*2dedff36SNick Mathewson KQueue: 234*2dedff36SNick Mathewson o Use SIG_IGN instead of a do-nothing handler for signal events with 235*2dedff36SNick Mathewson kqueue (148458e Zack Weinberg) 23634045c8fSNick Mathewson 237*2dedff36SNick Mathewson evprc: 238*2dedff36SNick Mathewson o event_rpcgen.py now prints status information to stdout and errors to 239*2dedff36SNick Mathewson stderr. (ffb0ba0 Ross Lagerwall) 24034045c8fSNick Mathewson 241*2dedff36SNick Mathewson Code improvement and refactoring: 242*2dedff36SNick Mathewson o Make event_reinit() more robust and maintainable (272033e) 243*2dedff36SNick Mathewson o Restore fast-path event_reinit() for slower backends (2c4b5de) 244*2dedff36SNick Mathewson o Check changelist as part of checking representational integrity (39b3f38) 245*2dedff36SNick Mathewson o Fix a compile warning in event_reinit (e4a56ed Sebastian Hahn) 246*2dedff36SNick Mathewson o Refactor the functions that run over every event. (c89b4e6) 247*2dedff36SNick Mathewson o Remove the last vestiges of _EVENT_USE_EVENTLIST (a3cec90) 248*2dedff36SNick Mathewson o Make event-config.h depend on Makefile.am (2958a5c) 24934045c8fSNick Mathewson 250*2dedff36SNick Mathewson Build fixes: 251*2dedff36SNick Mathewson o Don't do clang version detection when disabling some flags (083296b 252*2dedff36SNick Mathewson Sebastian Hahn) 25334045c8fSNick Mathewson 254*2dedff36SNick Mathewson C standards conformance: 255*2dedff36SNick Mathewson o Check for NULL return on win32 mm_calloc, and set ENOMEM. (af7ba69) 256*2dedff36SNick Mathewson o Convert event-config.h macros to avoid reserved identifiers (68120d9) 257*2dedff36SNick Mathewson o Generate event-config.h using the correct macros. (f82c57e) 258*2dedff36SNick Mathewson o Convert include-guard macro convention to avoid reserved identifiers 259*2dedff36SNick Mathewson (3f8c7cd) 260*2dedff36SNick Mathewson o Make event_rpcgen.py output conform to indentifier conventions (372bff1) 261*2dedff36SNick Mathewson o Stop referring to an obsolete include guard in bench_http.h (5c0f7e0) 262*2dedff36SNick Mathewson o Make the generated event-config.h use correct include guards (639383a) 263*2dedff36SNick Mathewson o Fix all identifiers with names beginning with underscore. (cb9da0b) 264*2dedff36SNick Mathewson o Make event_rpcgen.py output conform to indentifier conventions, more 265*2dedff36SNick Mathewson (bcefd24) 266*2dedff36SNick Mathewson o Fix some problems introduced by automated identifier cleanup script 267*2dedff36SNick Mathewson (c963534) 268*2dedff36SNick Mathewson o Have all visible internal function names end with an underscore. (8ac3c4c) 269*2dedff36SNick Mathewson o Apply the naming convention to our EVUTIL_IS* functions (c7848fa) 270*2dedff36SNick Mathewson o Clean up lingering _identifiers. (946b584) 271*2dedff36SNick Mathewson o Fix doxygen to use new macro conventions (da455e9) 2727c3e0612SNick Mathewson 273*2dedff36SNick Mathewson Bugfixes: 274*2dedff36SNick Mathewson o Do not use system EAI/AI values if we are not using the system 275*2dedff36SNick Mathewson getaddrinfo. (7bcac07) 2767c3e0612SNick Mathewson 277*2dedff36SNick Mathewson Sample Code: 278*2dedff36SNick Mathewson o Fix up sample/event-test.c to use newer interfaces and make it 279*2dedff36SNick Mathewson actually work. (19bab4f Ross Lagerwall) 280*2dedff36SNick Mathewson o On Unix, remove event.fifo left by sample/event-test.c. (c0dacd2 Ross 281*2dedff36SNick Mathewson Lagerwall) 282*2dedff36SNick Mathewson o Rename event-test.c to event-read-fifo.c. (a5b370a Ross Lagerwall) 283*2dedff36SNick Mathewson o event-read-fifo: Use EV_PERSIST appropriately (24dab0b) 28415be0493SNick Mathewson 2851aa6826fSNiels Provos 286