1Changes in version 2.1.5-alpha (?? ??? 2014) 2 3 4Changes in version 2.1.4-alpha (21 Mar 2014) 5 6 Libevent 2.1.4-alpha adds a number of new miscellaneous APIs to make 7 Libevent more useful, including support for early close detection with 8 epoll via EPOLLRDHUP, triggering bufferevent callbacks, adding more 9 evhttp callbacks, and more. There are also numerous bugfixes, including 10 a number for finalize-related issues from 2.1.3-alpha; and an 11 alternative (non-primary!) cmake-based build mechanism. 12 13 New APIs (core) 14 o Added event_base_get_num_events() (0fa107d Mobai Zhang) 15 o New event_base_active_by_fd API (865a142 Greg Hazel, 5c9da9a, 87fa2b0) 16 o Add event_base_active_by_signal by analogy (4865943) 17 o Add access to max event count stats (5173bef, efbd3dc, 26230a2 18 Andrew Sweeney) 19 o Implemented EV_CLOSED event for epoll backend 20 (EPOLLRDHUP). (b1b69ac Diego Giagio, 53d2793, 43ffcf6, dfe1e52 21 Marcin Juszkiewicz, ff26633 Joakim Soderberg, 3908a5e) 22 23 New APIs (evutil_secure_rng) 24 o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) 25 26 New APIs (bufferevents) 27 o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey) 28 o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb 29 Mark Ellzey) 30 o Add watermark introspection (4ce242b Ondřej Kuzník) 31 o Add an option to trigger bufferevent I/O callbacks (61ee18b Ondřej Kuzník) 32 o Add an option to trigger bufferevent event callbacks (a7384c7 33 Ondřej Kuzník) 34 o Clarifications in response to merge req. comments (bd41947 Ondřej 35 Kuzník) 36 o Minor optimizations on bufferevent_trigger options (a3172a4) 37 38 New APIs (evhttp) 39 o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion) 40 o add a http default content type option (5a5acd9 Nicolas Martyanoff) 41 o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat 42 Khuzhin) 43 o Add a variant of evhttp_send_reply_chunk() with a callback on 44 evhttp_write_buffer() (8d8decf Julien BLACHE) 45 o Allow registering callback for parsing HTTP headers (b0bd7fe Balint Reczey) 46 o Provide on request complete callback facility (b083ca0 Andrew Sweeney) 47 o evhttp_request_set_on_complete_cb to be more specific about what 48 the function actually does and usage (da86dda Andrew Sweeney) 49 o Update unit test to make sure that the callback happens after the 50 output data is written (b85f398 Andrew Sweeney) 51 52 Features (evdns) 53 o bug fix for issues #293 evdns_base_load_hosts doesn't remove 54 outdated addresses (954d2f9, f03d353, 45eba6f Kuldeep Gupta) 55 56 Features: (cmake build support) 57 o Initial CMake commit. (e415196 Joakim Soderberg) 58 o Add all tests and benchmarks to CMake project. (e9fc014 Joakim Soderberg) 59 o More work on adding tests to CMake project (99c1dc3 Joakim Soderberg) 60 o Generate a dummy evconfig-private.h so things build 61 properly. (ce14def Joakim Soderberg) 62 o Link libm on unix platforms. (58fcd42 Joakim Soderberg) 63 o Added some GCC specific options. (19222e5 Joakim Soderberg) 64 o Use evutil_closesocket instead. (dbf2b51 Joakim Soderberg) 65 o Add copyright and licensing files for CMake modules. (c259d53 66 Joakim Soderberg) 67 o Only include WIN32 getopt where it is used. (9bbce0b Joakim Soderberg) 68 o Fix bench_cascade program on Windows. (78da644 Joakim Soderberg) 69 o Don't segfault on no found event backend. (8f2af50 Joakim Soderberg) 70 o Only test the event backends available on the system. (7ea4159 71 Joakim Soderberg) 72 o Added a "make verify" target. (e053c4f Joakim Soderberg) 73 o Fix the make "verify" target on Windows. (67e5d74 Joakim Soderberg) 74 o Get rid of deprecation warnings for OpenSSL on OSX 10.7+ (69c3516 75 Joakim Söderberg) 76 o Fix kqueue support. (a831f2f Joakim Söderberg) 77 o Added a test for testing if kqueue works with pipes. (2799b35 78 Joakim Söderberg) 79 o Change the BSD license from 4 to 3-clause. (86df3ed Joakim Soderberg) 80 o Minimum required python version is 2.4. (968e97b Joakim Soderberg) 81 o Get rid of unknown pragma warnings. (0ef1d04 Joakim Soderberg) 82 o Add a "make verify_coverage" target generation coverage 83 info. (f2483f8 Joakim Soderberg) 84 o Fix the "make verify" target on NetBSD (4ac086a Joakim Soderberg) 85 o Only look for ZLib when it is used (if tests are 86 included). (f780593 Joakim Soderberg) 87 o Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into 88 errors. (dd413bd Joakim Soderberg) 89 o Add CMake config and install targets. (f3446ed Joakim Soderberg) 90 o Fix typo (4b754df Joakim Soderberg) 91 o Some work on making it possible to simply do add_subdirectory() on 92 the project. (49ab363 Joakim Soderberg) 93 o Set USE_DEBUG=1 on EVENT__ENABLE_VERBOSE_DEBUG (fd42e70 Joakim Soderberg) 94 o Fix so that old nmake project still builds. (24d6466 Joakim 95 Soderberg) 96 o Rename README to README.md and use markdown to format. (d2bc39a 97 Joakim Soderberg) 98 o Update README with CMake build instructions. (604b8cc Joakim Soderberg) 99 o Clean up the README some. (8d4cb35 JoakimSoderberg) 100 o Forgotten headers for old nmake project compatability. (8697b99 101 Joakim Soderberg) 102 o Change all uses of WIN32 to _WIN32 (4e14395 Joakim Söderberg) 103 o Fix include bug. (2024467 Joakim Söderberg) 104 o Check if we're on OSX before disabling deprecation in le-proxy 105 (8b40a5b Joakim Söderberg) 106 o Fix broken autotools build. (ae1bd82 Joakim Söderberg) 107 o Disclaimerize cmake a little in the README (d03b5bf) 108 o Fix CMake compile when OpenSSL is disabled. (e423d42 Joakim 109 Söderberg) 110 o CMake: Get rid of python not found warning when regress tests 111 turned off. (d38d798 Joakim Söderberg) 112 o Fix https-client compilation on Windows. (d7be788 Joakim Soderberg) 113 o Guard against EVENT_NOWIN32 being set during testing. (f1715b4 114 Joakim Soderberg) 115 o Check for OSX when checking for clang. (e212c54 Joakim Soderberg) 116 o Added a Travis-CI configuration file. (8c0f0a9 Joakim Soderberg) 117 o Added -Qunused-arguments for clang on macosx (ed99d92 Trond Norbye) 118 o Rename event_extras to event_extra (a0dd5df Trond Norbye) 119 o Add option to build shared library (4545fa9 Trond Norbye) 120 o Add -Qunused-arguments for clang on macos (b56611d Trond Norbye) 121 o Add cmake-related files to .gitignore (e061321 Trond Norbye) 122 o Export event_extra not event_extras. (2b41bcf Joakim Söderberg) 123 124 Bugfixes (core) 125 o If evsel->del() fails, don't leave the evmap in an inconsistent 126 state (9b5a527 Maxime Henrion) 127 o Move event_debug_note_teardown_ before mm_free. (69b5c64) 128 o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3) 129 o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe) 130 o Tweaked callbacks to prevent race condition 131 (https://github.com/libevent/libevent/issues/104) (40830f1, 2ea15ed 132 John Ohl) 133 o Move assert(ev) to before we use ev in EV_CLOSURE_EVENT_FINALIZE 134 case (9805972) 135 136 Bugfixes (evhttp) 137 o Fix a double close() bug in evhttp when the underlying bufferevent uses 138 BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion) 139 o Fix an unlikely but possible error case for http connections (f22049e) 140 o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) 141 142 Bugfixes on 2.0 (Windows) 143 o Use windows vsnprintf fixup logic on all windows environments (e826f19) 144 o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) 145 (b8f5980 Frank Denis) 146 147 Bugfixes (evutil_secure_rng) 148 o When we seed from /proc/sys/kernel/random/uuid, count it as success 149 (e35b540) 150 o We should return after arc4random_buf() (1ea1f26 Makoto Kato) 151 o Avoid other RNG initialization FS reads when urandom file is 152 specified (9695e9c) 153 o Really remove RNG seeds from the stack (f5ced88) 154 o Fix another arc4random_buf-related warning (e64a2b0) 155 156 Bugfixes (bufferevents) 157 o Initialize async bufferevent timeout CBs unconditionally (af9b2a7) 158 159 Bugfixes (evdns) 160 o Checking request nameserver for NULL, before using it. (5c710c0 161 Belobrov Andrey) 162 o Fix SEGFAULT after evdns_base_resume if no nameservers 163 installed. (14971a8 Azat Khuzhin) 164 o Actually use the log facility for reporting evdns problems. (e1766a1) 165 o Fix SEGFAULT after evdns_base_resume if no nameservers 166 installed. (f8d7df8 Azat Khuzhin) 167 o fix for ServFail from RIPE Atlas release (62f596b Antony Antony) 168 169 Bugfixes (compilation) 170 o Fix test compilation with nmake: add the gdi.lib dependency (5ba8ab7) 171 o Whoops. It is gdi.lib, not gdi32.lib. (github issue #61) (8ab612e) 172 o Don't use return since return type is void and build error occurs 173 using clang (838161d Makoto Kato) 174 o Use void casts to suppress some "unchecked return value" warns (7080d55) 175 o rpcgen: Generate regress.gen.[c,h] in build rather than src dir 176 (243386c Ross Lagerwall) 177 o Fix a compiler warning when checking for arc4random_buf linker 178 breakage. (5cb3865) 179 o Fix 'make distcheck' by adding regress.gen.[ch] to DISTCLEANFILES 180 (239d834) 181 182 o Fix a c90 warning (c207682) 183 o Fix consts in WIN32-Code/getopt*.[ch] (57abb35) 184 185 Bugfixes (locks, synchronization) 186 o Missed lock acquire/release in event_base_cancel_single_callback_() 187 (d3d999a Azat Khuzhin) 188 o Fix locking in bufferevent_get_options_(). (dbc9cd4 Maxime Henrion) 189 190 Bugfixes (leaks) 191 o Avoid leaking segment mappings when offset is not a page multiple (d409514) 192 193 Testing 194 o Add tests for evdns_base_resume(). (1cd9ff5 Azat Khuzhin) 195 o Fix dns/leak_resume_send_err test. (7e876df Azat Khuzhin) 196 o Add checks for evhttp_connection_get_server() in unit 197 tests. (fbc323b Maxime Henrion) 198 o Fix a (failure-only) null dereference in the unit tests (1104d0b) 199 o Fix a logic error in test_evbuffer_freeze (7765884) 200 o Add missing check to test_evbuffer_file_segment_add_cleanup_cb (eba4506) 201 o Fix some crash-on-fail cases in DNS regression tests (87cd6f0) 202 o DNS tests: add a missing check (f314900) 203 o Finalize tests: add a missing check (82b6956) 204 o test_evutil_rtrim: add another missing check. (e193c95) 205 o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset 206 (611e28b Azat Khuzhin) 207 o regress_http: add tests for evhttp_connection_get_addr() (4dd500c 208 Azat Khuzhin) 209 o Update to the latest version of tinytest (7a80476) 210 o Heap-allocate zlib data structure in regress_zlib tests (4947c18) 211 212 Performance tweaks (core) 213 o Avoid redundant syscall to make a nonblocking socket nonblocking 214 (42c03da Maxime Henrion) 215 o Avoid redundant syscall if making a socket cloexec twice (1f29b18) 216 o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62) 217 218 Documentation 219 o Document that arc4random is not a great cryptographic PRNG. (6e49696) 220 o Small doxygen tweaks (6e67b51) 221 o Try another doxygen tweak (ccf432b) 222 o Clarify event_base_loop exit conditions (031a803) 223 o Fix a typo (be7bf2c Ondřej Kuzník) 224 o Document deferred eventcb behaviour (13a9a02 Ondřej Kuzník) 225 o Typo fixes from Linus Nordberg (cec62cb, 8cd695b) 226 o Fix duplicate paragraph in evbuffer_ptr documentation (58408ee) 227 228 Code Improvements (coverity) 229 o Fix a pile of coverity warnings in the unit tests (867f401) 230 o Fix coverity warnings in benchmark tools. (ff7f739) 231 o Whoops; fix compilation in bench.c (544cf88) 232 o Remove spurious checks in evrpc.c error cases (coverity) (991b362) 233 o Fix a couple of compilation warnings in regress_http.c (860767e) 234 o Fix even more coverity warnings. (d240328) 235 o Stop checking for inet_aton; we don't use it. (f665d5c) 236 o Add an include to evrpc-internal to fix openbsd compilation warning 237 (5e161c6) 238 239 Cleanups 240 o Remove an unreachable return statement in minheap-internal.h (e639a9e) 241 o Refactor evmap_{io,signal}_active_() to tolerate bad inputs (974c60e) 242 o Fix needless bufferevent includes in evdns.c (254c04e) 243 o Fix a couple of "#ifdef WIN32" instances (88ecda3) 244 o Remove unneeded declaration in bufferevent-internal.h (4c8ebcd) 245 246 Sample code 247 o le-proxy: Fail more gracefully if opening listener fails (44b2491) 248 o http-server: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin) 249 o https-client: POST supported, args supported (c5887f7 Alexey Ozeritsky) 250 o https-client: code cleanup (29af65e Alexey Ozeritsky) 251 o https-client: Small tweaks to https-client.c (90786eb) 252 o https-client: Set hostname for SNI extension (by f69m) (d1976f8) 253 o https-client: add a cast to https-client.c (462e6b6) 254 255 256 257Changes in version 2.1.3-alpha (1 May 2013) 258 259 Libevent 2.1.3-alpha fixes various bugs, adds new unit tests, and cleans 260 up the code in a couple of places. It has a new callback in evhttp for 261 reporting errors during a request, a new feature for allowing evdns to 262 not keep the event_base looping when there are no requests inflight, and 263 example code for writing an https client. 264 265 Libevent 2.1.3-alpha also has an important new (experimental) event 266 finalization feature to allow safe event teardown in multithreaded 267 programs. This ought to fix the longstanding bug with deadlocks in 268 multithreaded use of SSL-based bufferevents that some people have been 269 experiencing since Libevent 2.0. 270 271 272 Core (event finalization) 273 o Implement event_finalize() and related functions to avoid certain 274 deadlocks (8eedeab) 275 o Use finalization feature so bufferevents can avoid deadlocks (02fbf68) 276 o Always run pending finalizers when event_base_free() is called (e9ebef8) 277 o Remove bufferevent_del_generic_timeout_cbs as now unused (4ea4c6a) 278 o More documentation for finalization feature (a800b91) 279 o Make the event_finalize* functions return an error code (5d11f4f) 280 o Mark the finalize stuff as experiemental in case it needs to 281 change (23e2e29) 282 283 Evdns 284 o evdns: New flag to make evdns not prevent the event loop from 285 exiting (6b7fa62 Azat Khuzhin) 286 287 Bugfixes (Core) 288 o Make event_remove_timer behave correctly with persistent timers (5623e80) 289 o Unit test for event_remove_timer with EV_PERSIST. (96150dd) 290 o Double-check next timeout when adding events (9443868 Nate Rosenblum) 291 o event_base_update_cache_time should be a no-op if the loop isn't 292 running (5e6fa2a) 293 294 Bugfixes (evhttp, crash fix, from 2.0) 295 o fix #73 and fix http_connection_fail_test to catch it (b618204 Greg Hazel) 296 297 Bugfixes (compilation and portability, from 2.0) 298 o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739) 299 o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan) 300 o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) 301 (74d4c44 Kevin Bowling) 302 o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 303 1.13 compat (817ea36) 304 o Rename configure.in to configure.ac to appease newer autoconfs (0c79787) 305 o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e) 306 307 Bugfixes (resource leaks/lock errors on error, from 2.0) 308 o Avoid leaking fds on evconnlistener with no callback set (69db261) 309 o Avoid double-close on getsockname error in evutil_ersatz_socketpair 310 (0a822a6) 311 o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e) 312 313 Documentation Fixes (from 2.0) 314 o Fix a mistake in evbuffer_remove() arguments in example http server code 315 (c322c20 Gyepi Sam) 316 o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5) 317 318 Documentation Fixes 319 o minor documentation typos (809586a Patrick Pelletier) 320 o Fix cut-and-paste err in whatsnew-2.1 (49905ac) 321 o Fix comment to refer to sample/include.am correctly (9e8cdf3 Sebastian 322 Hahn) 323 o Fix typo : Dispatching instead of Dispaching (0c2bacc Volker Lendecke) 324 o fix some hinky indentation in evhttp_make_request (80e220e Patrick 325 Pelletier) 326 o "buffer" spelling (a452811 Patrick Pelletier) 327 o Specify return behavior in header for evbuffer_pullup() in corner case 328 (cf8d1cd Dan Petro) 329 o Clarify an important point about event_base_foreach_event() (920a5e6) 330 331 Compilation Fixes/Tool Support 332 o avoid valgrind false positive by zeroing epoll_event (1258614 Patrick 333 Pelletier) 334 o Fix harmless clang enum warning (b452a43 Sebastian Hahn) 335 o remove all exes on "make clean", not just regress.exe (974bfa0 Patrick 336 Pelletier) 337 o Make --disable-libevent-regress work again (787fd74) 338 o Do not build strlcpy.c when it will have no code. (4914620) 339 340 Portability Fixes 341 o When EWOULDBLOCK is not EAGAIN, treat it as equivalent to it (bf7a0ff) 342 o Preliminary changes for Minix3. (0dda56a Nicholas Heath) 343 o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 344 compat (bf278b) 345 o Avoid using $(top_srcdir) in TESTS. (2863c83) 346 o build test/test-script.sh on systems with a less-featureful $< (f935e21) 347 o Implement EVUTIL_ERR_IS_EAGAIN on windows. (42aaf4d) 348 349 Evhttp changes: 350 o Fix ipv6 support for http. When URL contain domain, not IP 351 address. (71e709c Azat Khuzhin) 352 o uri decode: fix for warning "use of uninitialised value" (64b6ece Azat 353 Khuzhin) 354 o uri decode: changed the test for the existence of the next character 355 (e1903e3 Azat Khuzhin) 356 o Move prototype of evhttp_decode_uri_internal() to http-internal.h 357 (de8101a Azat Khuzhin) 358 o Test: decoding just part of string with evhttp_decode_uri_internal() 359 (1367653 Azat Khuzhin) 360 o Add new error_cb for actual reporting of HTTP request errors. (7b07719 361 Azat Khuzhin) 362 o Add test for EVREQ_HTTP_REQUEST_CANCEL into http_cancel_test() (862c217 363 Azat Khuzhin) 364 o Drop extra header http_struct.h from regress_http.c (54cc800 Azat Khuzhin) 365 366 Testing 367 o Add regress test ipv6_for_domain. (9ec88bd Azat Khuzhin) 368 o Add an environment variable (EVENT_DEBUG_MODE) to run unit tests in debug 369 mode (2fad0f3) 370 o Add a test with an active_later event at event_base_free time. (1c3147f) 371 o Make all tests pass under EVENT_DEBUG_MODE=1 (b1b054f) 372 o Add some verbose notes to bufferevent unit tests (9d893c9) 373 o New test for active_later->active transition on event_active (a153874) 374 o New tests for event_base_foreach_event() (0b096ef) 375 o Unit tests for event_base_gettimeofday_cached() and 376 event_base_update_cache_time() (30ea291) 377 o A test for event_get_assignment() (f09629e) 378 o More unit tests for initializing common timeouts. (d596739) 379 o Fix a bug in the new main/event_foreach test (702c9aa) 380 381 Windows: 382 o use FormatMessage for winsock errors (0c6ec5d, 2078e9b, 4ccdd53, c9ad3af 383 Patrick Pelletier) 384 o a program to print out the error strings for winsock errors (7296512 385 Patrick Pelletier) 386 o Fix a warning introduced in 0c6ec5d8 (eeb700c) 387 o Fix another warning introduced in 0c6ec5d8 (ed26561) 388 389 Examples (http) 390 o Add sample/https-client.c, an example of stacking evhttp as a client on 391 top of bufferevent_ssl. (be46c99 Catalin Patulea) 392 o use ${OPENSSL_LIBS} instead of -lssl -lcrypto (bf31fa5 Patrick Pelletier) 393 o https-client was putting newlines at 256-byte boundaries (42d7441 Patrick 394 Pelletier) 395 o better handling of OpenSSL errors (5754d96 Patrick Pelletier) 396 o use Debian's default root certificate location (aacd674 Patrick Pelletier) 397 o use iSECPartners code to validate hostname in certificate (64d9f16 398 Patrick Pelletier) 399 o avoid sign mismatch warning in openssl_hostname_validation.c (6021cb5 400 Patrick Pelletier) 401 o pull in wildcard matching code from cURL (4db9da6 Patrick Pelletier) 402 o Another tweak to https-client.c (95acdaa) 403 o Remove http_struct.h usage in sample/https-client.c (8a90a85) 404 405 406 407Changes in version 2.1.2-alpha (18 Nov 2012) 408 409 Libevent 2.1.2-alpha includes more portable for monotonic timers, 410 refactors much of Libevent's internal and external infrastructure, 411 closes some longstanding gaps in the interface, makde other 412 improvements. Ths log below tries to organize features by rough area of 413 effect. It omits a few commits which were pure bugfixes on other commits 414 listed below. For more detail, see the git changelogs. For more 415 insight, see the "whatsnew-2.1.txt" document included in the Libevent 416 2.1.2-alpha distribution. 417 418 Libevent 2.1.2-alpha also includes all changes made in 2.0.19-stable 419 through 2.0.21-stable inclusive. 420 421 Performance (core): 422 o Replace pipe-based notification with EVFILT_USER where possible. This 423 should make multithreaded programs on OSX and *BSD alert the main thread a 424 little faster. (53a07fe) 425 o Make th_base_lock nonrecursive. (9cd5acb) 426 427 New/Changed API Functions: 428 o New event_get_priority() function to return an event's priority (f90e255) 429 o Add a bufferevent_get_priority() function (bd39554) 430 o Add an event_base_loopcontinue() to tell Libevent to rescan for more 431 events right away (7d6aa5e) 432 o Add a new callback to get called on evbuffer_file_segment free 433 (e9f8feb yangacer, 64051b9) 434 o Expose event_base_foreach_event() as a public API. (84fd6d7 Roman 435 Puls, 232055e, ffe1643) 436 o Add an event_remove_timer() to remove timer on an event without 437 deleting it (e3b2e08) 438 o Make bufferevent_set_timeouts(bev, NULL, NULL) have plausible 439 semantics (9dee36b) 440 o Rename event_enable_lock_debuging() to ..._debugging(). (The old name 441 should still work.) (07e132e) 442 o Add missing implementation for event_enable_debug_logging (3b3e21d) 443 444 PORTABLE MONOTONIC TIMERS: 445 446 Libevent 2.1.2 includes internal support for monotonic timers on 447 (nearly) all supported platforms, including Windows, and OSX. Libevent 448 applications should now be more resilient to jumps forwards or backwards 449 in the system clock. Also, on Linux systems with epoll, we now 450 optionally support microsecond-level timeouts (whereas epoll only 451 supports millisecond-precision timeouts). 452 453 o Use mach_absolute_time() for monotonic clock support on OSX. (b8fd6f9) 454 o Do not track use_monotonic field when is no monotonic clock (cb653a0) 455 o EVENT_BASE_FLAG_PRECISE_TIMER indicates we want fine timer precision 456 (ddd69d3) 457 o On Linux, use CLOCK_MONOTONIC_COARSE by default (55780a7) 458 o Implement a GetTickCount-based monotonic timer for Windows (d5e1d5a) 459 o Refactor monotonic timer handling into a new type and set of 460 functions; add a gettimeofday-based ratcheting implementation (f5e4eb0) 461 o Add EVENT_PRECISE_TIMER environment var for selecting precise-but-slow 462 timer (a2598ec) 463 o Implement fast/precise monotonic clocks on Windows (2c47045) 464 o Simple unit tests for monotonic timers (630f077) 465 o Improve the monotonic-time unit test: make it check the step size (7428c78) 466 o When PRECISE_TIMERS is set with epoll, use timerfd for microsecond 467 precision (26c7582) 468 o Split out time-related evutil functions into a new evutil_time.c (c419485) 469 o Split out time-related prototypes into time-internal.h (71bca50) 470 o Add evutil_time.obj to Makefile.nmake (0ba0683) 471 o Avoid giving a spurious warning when timerfd support is unavailable 472 (1aaf9f0 Dave Hart) 473 o Make test_evutil_monotonic a little more tolerant (def3b83) 474 o Avoid unused-var warning on systems with clock_gettime but without 475 CLOCK_MONOTONIC_COARSE (9be5468) 476 477EVENT_BASE_ONCE LEAKS: 478 If a callback added by event_base_once() is never invoked, Libevent no 479 longer leaks internal memory. 480 481 o Free dangling event_once objects on event_base_free() (c17dd59) 482 o Add a unit test in which an event is created with event_base_once() 483 but never fires (4343edf) 484 485TESTING SUPPORT, FIXES AND IMPROVEMENTS: 486 487 Libevent now disables by default its unit tests that would touch the 488 network, or that tend to fail on heavily-loaded systems. To re-enable 489 them, invoke the ./test/regress program with the @all alias. 490 491 o Simplify test.sh code significantly. (9b856fd Ross Lagerwall) 492 o Make all tests that hit the network disabled by default (f2cea87) 493 o Avoid a resource leak on error in http client benchmark (ea92fba) 494 o Update to latest tinytest (911b4f0349377) (ef7c4f7) 495 o Avoid (unlikely) overflow in bench_httpclient.c (5671033) 496 o Shave 700 msec off the persistent_timeout_jump test (21205b8) 497 o Check return value of write() in regress.c (c8009d2) 498 o Make load-dependent monotonic timer tests off-by-default (2b6fe8b) 499 o Add deferred_cb_skew to list of timing-dependent tests (34c8f31) 500 o Avoid test -e; older shs don't have one. (f1bd938) 501 o Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086) 502 o Fix a couple of compile warnings in the unit tests (5a9a014) 503 504MISC: 505 o Change evutil_weakrand_() to avoid platform random() (e86af4b Nicholas 506 Marriott, 3aa4415) 507 508INFRASTRUCTURE (Active-later events): 509 As a simplification and optimization to Libevent's "deferred callback" 510 logic (introduced in 2.0 to avoid callback recursion), Libevent now 511 treats all of its deferrable callback types using the same logic it uses 512 for active events. Now deferred events no longer cause priority 513 inversion, no longer require special code to cancel them, and so on. 514 515 o Refactor the callback part of an event into its own event_callback 516 type (cba59e5) 517 o Add "active later" event_callbacks to supersede deferred (745a63d) 518 o event_base_assert_ok: check value of event_active_count for 519 correctness (fec8bae) 520 o Replace deferred_cbs with event_callback-based implementation. (ae2b84b) 521 o Replace more deferred_cb names with event_callback (a4079aa) 522 o Give event_base_process_active a single exit path (581b5be) 523 o Restore our priority-inversion-prevention code with deferreds (c0e425a) 524 o Refactor event_persist_closure: raise and extract some common logic 525 (bec22b4) 526 o Remove the unused bits from EVLIST_ALL (9889a3d) 527 528BUILD IMPROVEMENTS: 529 Libevent 2.1.2-alpha modernizes Libevent's use of autotools, and makes 530 numerous other build system. Parallel builds should be faster, and all 531 builds should be quieter. 532 533 o Split long lists in Makefile.am into one-item-per-line (2711cda) 534 o Remove unnecessary code in configure.in. (e65914f Ross Lagerwall) 535 o attempt to support OpenSSL in Makefile.nmake (eba0eb2 Patrick Pelletier) 536 o Use newer syntax for autoconf/automake init (7d60ba8) 537 o Enable silent build rules by default. Override with V=1 (7b18e5c) 538 o Switch to non-recursive makefiles (7092f3b) 539 o Rename subordinate Makefile.ams to include.am (6cdfeeb) 540 o Make quiet build even quieter (371a123) 541 o New --quiet option for event_rpcgen.py (aa59c1e) 542 o Be quiet when making regress.gen.[ch] (607a8ff) 543 o Fix handling of no-python case for nonrecursive make (1e3123d) 544 o We now require automake 1.9 or later. Modernize! (b7f6e89) 545 o Rename configure.in to configure.ac. (b3fea67 Ross Lagerwall) 546 o Use correct openssl libs and includes in pkgconfig file (d70af27) 547 o Use the same CFLAGS for openssl when building unit tests as with 548 libevent (1d9d511) 549 550DOCUMENTATION 551 o Note that make_base_notifiable should not be necessary (26ee5f9) 552 o Be more clear that LEV_OPT_DEFERRED_ACCEPT has tricky prereqs (371efeb) 553 o Add caveat to docs about bufferevent_free() with data in outbuf (6fab9ee) 554 o Make it more clear that NOLOCK means "I promise, no multithreading" 555 (9444524) 556 o Fix a comment in test-fdleak after 077c7e949. (3881d8f Ross Lagerwall) 557 o Make the Makefile.nmake warning slightly less dire (e7bf4c8) 558 o Fix typo : events instead of evets (05f1aca Azat Khuzhin) 559 o Additional comments about OPENSSL_DIR variable, prompted by Dave Hart 560 (6bde2ef Patrick Pelletier) 561 562EVHTTP: 563 o ignore LWS after field-content in headers (370a2c0 Artem Germanov) 564 o Clean up rtrim implementation (aa59d80) 565 o Remove trailing tabs in HTTP headers as well. (ac42519) 566 o Remove internal ws from multiline http headers correctly (c6ff381) 567 o Move evutil_rtrim_lws_ to evutil.c where it belongs (61b93af) 568 o add evhttp_request_get_response_code_line (4f4d0c9 Jay R. Wren) 569 o Use EVUTIL_SOCKET_ERROR() wrapper to save/restore errno in 570 evhttp_connection_fail_ (7afbd60) 571 o preserve errno in evhttp_connection_fail_ for inspection by the 572 callback (36d0ee5 Patrick Pelletier) 573 574BUGFIXES: 575 o Correctly handle running on a system where accept4 doesn't work. (9fbfe9b) 576 o Avoid double-free on error in evbuffer_add_file. Found by 577 coverity. (6a81b1f) 578 o Fix another possible uninitialized read in dns regression tests. Found 579 by coverity. (13525c5) 580 o Add checks for functions in test-ratelim.c; found by Coverity (aa501e1) 581 o Avoid memory leak in test_event_calloc unit test; found by coverity 582 (92817a1) 583 o Fix a shadowed variable in addfile_test_readcb; found by coverity 584 (225344c) 585 o Check return value when using LEV_OPT_DEFERRED_ACCEPT. Found by 586 coverity (6487f63) 587 o Prevent reference leak of bufferevent if getaddrinfo fails. (b757786 588 Joachim Bauch) 589 o Make event_base_getnpriorities work with old "implicit base" code 590 (c46cb9c) 591 o Simplify and correct evutil_open_closeonexec_ (0de587f) 592 o Fix event_dlist definition when sys/queue not included (81b6209 593 Derrick Pallas) 594 595 596 597Changes in version 2.1.1-alpha (4 Apr 2012) 598 599 Libevent 2.1.1-alpha includes a number of new features and performance 600 improvements. The log below tries to organize them by rough area of 601 effect. It omits some commits which were pure bugfixes on other commits 602 listed below. For more detail, see the git changelogs. For more 603 insight, see the "whatsnew-2.1.txt" document included in the Libevent 604 2.1.1-alpha distribution. 605 606 Performance: Core 607 o Replace several TAILQ users with LIST. LIST can be a little faster than 608 TAILQ for cases where we don't need queue-like behavior. (f9db33d, 609 6494772, d313c29, 974d004) 610 o Disabled code to optimize the case where we reinsert an existing 611 timeout (e47042f, 09cbc3d) 612 o Remove a needless base-notify when rescheduling the first timeout (77a96fd) 613 o Save a needless comparison when removing/adjusting timeouts (dd5189b) 614 o Possible optimization: split event_queue_insert/remove into 615 separate functions. needs testing (efc4dc5) 616 o Make event_count maintenance branchless at the expense of an 617 extra shift. Needs benchmarking (d1cee3b) 618 o In the 2.1 branch, let's try out lazy gettimeofday/clock_gettime 619 comparison (2a83ecc) 620 o Optimization in event_process_active(): ignore maxcb & endtime 621 for highest priority events. (a9866aa Alexander Drozdov) 622 o Bypass event_add when using event_base_once() for a 0-sec timeout (35c5c95) 623 o Remove the eventqueue list and the ev_next pointers. (604569b 066775e) 624 625 Performance: Evbuffers 626 o Roughly 20% speed increase when line-draining a buffer using 627 EVBUFFER_EOL_CRLF (5dde0f0 Mina Naguib) 628 o Try to squeeze a little more speed out of EVBUFFER_EOL_CRLF (7b9d139) 629 o Fix a bug in the improved EOL_CRLF code (d927965) 630 o Remove a needless branch in evbuffer_drain() (d19a326) 631 632 Performance: Linux 633 o Infrastructure for using faster/fewer syscalls when creating 634 sockets (a1c042b) 635 o Minimize syscalls during socket creation in listener.c (7e9e289) 636 o Use a wrapper function to create the notification 637 pipe/socketpair/eventfd (ca76cd9) 638 o Use pipes for telling signals to main thread when possible (a35f396) 639 o Save syscalls when constructing listener sockets for evhttp (af6c9d8) 640 o Save some syscalls when creating evdns sockets (713e570) 641 o Save some syscalls when constructing a socket for a bufferevent (33fca62) 642 o Prefer epoll_create1 on Linuxen that have it (bac906c) 643 644 Performance: Epoll backend 645 o Use current event set rather than current pending change when 646 deciding whether to no-op a del (04ba27e Mike Smellie) 647 o Replace big chain of if/thens in epoll.c with a table lookup (8c83eb6) 648 o Clean up error handling in epoll_apply_one_change() a little (2d55a19) 649 650 Performance: Evport backend 651 o evport: use evmap_io to track fdinfo status. Should save time and 652 RAM. (4687ce4) 653 o evport: Remove a linear search over recent events when 654 reactivating them (0f77efe) 655 o evport: Use portev_user to remember fdinfo struct (276ec0e) 656 o evport: don't scan more events in ed_pending than needed (849a5cf) 657 o evport: Remove artificial low limit on max events per getn call (c04d927) 658 o Reenable main/many_events_slow_add for evport in 2.1 (e903db3) 659 660 Performance: Windows 661 o Use GetSystemTimeAsFileTime to implement gettimeofday on 662 win32. It's faster and more accurate than our old 663 approach. (b8b8aa5) 664 665 New functions and features: debugging 666 o Add event_enable_debug_logging() to control use of debug logs (e30a82f) 667 668 New functions and features: core 669 o Add event_config function to limit time/callbacks between calls 670 to dispatch (fd4de1e, 9fa56bd, a37a0c0, 3c63edd) 671 o New EVLOOP_NO_EXIT_ON_EMPTY option to keep looping even when no 672 events are pending (084e68f) 673 o Add event_base_get_npriorities() function. (ee3a4ee Alexander Drozdov) 674 o Make evbase_priority_init() and evbase_get_npriorities() 675 threadsafe (3c55b5e) 676 o New event_base_update_cache_time() to set cached_tv to current 677 time (212533e Abel Mathew) 678 o Add event_self_cbarg() to be used in conjunction with 679 event_new(). (ed36e6a Ross Lagerwall, fa931bb, 09a1906, 1338e6c, 680 33e43ef) 681 o Add a new libevent_global_shutdown() to free all globals before 682 exiting. (041ca00 Mark Ellzey, f98c158, 15296d0, 55e991b) 683 o Use getifaddrs to detect our interfaces if possible (7085a45) 684 o Add event_base_get_running_event() to get the event* whose cb we 685 are in (c5732fd, 13dad99) 686 687 New functions and features: building 688 o Implement --enable-gcc-hardening configure option (7550267 Sebastian Hahn) 689 690 New functions and features: evbuffers 691 o Add evbuffer_add_file_segment() so one fd can be used efficiently 692 in more than one evbuffer_add_file at a time (e72afae, c2d9884, 693 3f405d2, 0aad014) 694 o Fix windows file segment mappings (8254de7) 695 o Allow evbuffer_ptr_set to yield a point just after the end of the 696 buffer. (e6fe1da) 697 o Allow evbuffer_ptr to point to position 0 in an empty evbuffer 698 (7aeb2fd Nir Soffer) 699 o Set the special "not found" evbuffer_ptr consistently. (e3e97ae Nir Soffer) 700 o support adding buffers to other buffers non-destructively 701 (9d7368a Joachim Bauch) 702 o prevent nested multicast references, reworked locking (26041a8 703 Joachim Bauch) 704 o New EVBUFFER_EOL_NUL to read NUL-terminated strings from an 705 evbuffer (d7a8b36 Andrea Montefusco, 54142c9) 706 o Make evbuffer_file_segment_types adaptable (c6bbbf1) 707 o Added evbuffer_add_iovec and unit tests. (aaec5ac Mark Ellzey, 27b5398) 708 o Add evbuffer_copyout_from to copy data from the middle of a 709 buffer (27e2225) 710 711 New functions and features: bufferevents 712 o Allow users to set allow_dirty_shutdown (099d27d Catalin Patulea) 713 o Tweak allow_dirty_shutdown documentation (a44cd2b) 714 o Fix two issues in the allow_dirty_shutdown code. (f3b89de) 715 o Add a bufferevent_getcb() to find a bufferevent's current 716 callbacks (a650394) 717 o bufferevent: Add functions to set/get max_single_read/write 718 values. (998c813 Alexander Drozdov) 719 o bev_ssl: Be more specific in event callbacks. evhttp in particular gets 720 confused without at least one of BEV_EVENT_{READING|WRITING}. (f7eb69a 721 Catalin Patulea) 722 723 New functions and features: evconnlisteners 724 o Support TCP_DEFER_ACCEPT sockopts for listeners (5880e4a Mark Ellzey, 725 a270728) 726 o Add another caveat to the TCP_DEFER_ACCEPT documentation (a270728) 727 o Allow evconnlistener to be created in disabled state. (9593a33 728 Alexander Drozdov) 729 o The LEV_OPT_CLOSE_ON_EXEC flag now applies to accepted listener 730 sockets too (4970329) 731 732 Evhttp: 733 o Add new evhttp_{connection_}set_timeout_tv() functions to set 734 finger-grained http timeouts (6350e6c Constantine Verutin) 735 o Performance tweak to evhttp_parse_request_line. (aee1a97 Mark Ellzey) 736 o Add missing break to evhttp_parse_request_line (0fcc536) 737 o Add evhttp callback for bufferevent creation; this lets evhttp 738 support SSL. (8d3a850) 739 o Remove calls to deprecated bufferevent functions from evhttp.c (4d63758) 740 o evhttp: Add evhttp_foreach_bound_socket. (a2c48e3 Samy Al Bahra) 741 742 Build improvements: 743 o Add AC_USE_SYSTEM_EXTENSIONS to configure.in. Requires follow on 744 patches for correctness and robustness. (1fa7dbe Kevin Bowling) 745 o Filter '# define' statements from autoconf and generate 746 event-private.h (321b558 Kevin Bowling) 747 o Remove internal usage of _GNU_SOURCE (3b26541 Kevin Bowling) 748 o Eliminate a couple more manual internal _GNU_SOURCE defines (c51ef93 749 Kevin Bowling) 750 o Add AC_GNU_SOURCE to the fallback case. (ea8fa4c Kevin Bowling) 751 o Use a Configuration Header Template for evconfig-private.h (868f888 752 Kevin Bowling) 753 o Fix a comment warning and add evconfig-private.h to .gitignore 754 (f6d66bc Kevin Bowling) 755 o Include evconfig-private.h in internal files for great good. (0915ca0 756 Kevin Bowling) 757 o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) 758 (ad03952 Kevin Bowling) 759 o Prefer the ./configure evconfig-private.h in MinGW, just in 760 case. (f964b72 Kevin Bowling) 761 o Shell hack for weird mkdir -p commands (fd7b5a8 Kevin Bowling) 762 o Add evconfig-private to remaining files (ded0a09 Kevin Bowling) 763 o Allow use of --enable-silent-rules for quieter compilation with 764 automake 1.11 (f1f8514 Dave Hart) 765 o Use "_WIN32", not WIN32: it's standard and we don't need to fake it 766 (9f560b) 767 o In configure, test for _WIN32 not WIN32. (85078b1 Peter Rosin) 768 o Do not define WIN32 in Makefile.nmake (d41f3ea Peter Rosin) 769 o Provide the autoconf m4 macros for the new OpenSSL via pkg-config 770 stuff. (674dc3d Harlan Stenn) 771 o Use pkg-config (if available) to handle OpenSSL. (1c63860 Harlan Stenn) 772 o We need AM_CPPFLAGS when compiling bufferevent_openssl.c (6d2613b 773 Harlan Stenn) 774 o Fix OSX build: $(OPENSSL_INCS) needs to be after 775 $(AM_CPPFLAGS). (46f1769 Zack Weinberg) 776 o Make gcc warnings on by default, and --enable-gcc-warnings only add 777 -Werror (d46517e Sebastian Hahn) 778 o Split up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in (88a30ad) 779 o Move libevent 1.x headers to include/, to put all public headers in 780 one place. (bbea8d6) 781 o Put #ifdef around some files to support alternate build 782 systems. (76d4c92 Ross Lagerwall) 783 o Also make win32select.c conditional for IDE users (bf2c5a7) 784 785 Debugging: 786 o Add a magic number to debug_locks to better catch lock-coding 787 errors. (b4a29c0 Dave Hart) 788 o munge the debug_lock signature before freeing it: it might help us 789 catch use-after-free (f28084d) 790 o Added --enable-event-debugging in configure (bc7b4e4, a9c2c9a Mark Ellzey) 791 o Debug addition for printing usec on TIMEOUT debugging. (ac43ce0 Mark Ellzey) 792 o Added usec debug in another area for debug (3baab0d Mark Ellzey) 793 o added timeout debug logs to include event ptr. (4b7d298 Mark Ellzey) 794 o more event dbg updates (6727543 Mark Ellzey) 795 o Clarify event_enable_debug_logging a little (6207826) 796 o Make --enable-verbose-debug option match its help text (10c3450) 797 o Add argument checks to some memory functions in `event.c'. (c8953d1 798 Mansour Moufid) 799 800 Testing: 801 o More abstraction in test.sh (cd74c4e) 802 o Add failing test for evbuffer_search_range. (8e26154 Nir Soffer) 803 o Tweaks to return types with end-of-buf ptrs (9ab8ab8) 804 o Add an (internal) usleep function for use by unit tests (f25d9d3) 805 o Synchronize with upstream tinytest (6c81be7) 806 o Make test-changelist faster (7622d26) 807 o Reduce the timeout in the main/fork test. (ab14f7c) 808 o New evhttp function to adjust initial retry timeout (350a3c4) 809 o Make regression tests run over 3x faster. (67a1763) 810 o Use test_timeval_diff_eq more consistently (b77b43f) 811 o Allow more slop in deferred_cb_skew test; freebsd needs it (b9f7e5f) 812 o When including an -internal.h header outside the main tree, do so 813 early (95e2455) 814 o Add a new test: test-fdleak which tests for fd leaks by creating many 815 sockets. (2ef9278 Ross Lagerwall, f7af194, 1c4288f, etc) 816 o Add a unit test for event_base_dump_events() (7afe48a, 8d08cce) 817 o Test more bufferevent_ratelim features (c24f91a) 818 819 Documentation: 820 o Improve evbuffer_ptr documentation (261ba63) 821 o added comments to describe refcounting of multicast chains (ba24f61 822 Joachim Bauch) 823 o Add doxygen for event_base_dump_events (cad5753) 824 825 OSX: 826 o Use "unlimited select" on OSX so that we can have more than 827 FD_SETSIZE fds (1fb5cc6) 828 829 KQueue: 830 o Use SIG_IGN instead of a do-nothing handler for signal events with 831 kqueue (148458e Zack Weinberg) 832 833 evprc: 834 o event_rpcgen.py now prints status information to stdout and errors to 835 stderr. (ffb0ba0 Ross Lagerwall) 836 837 Code improvement and refactoring: 838 o Make event_reinit() more robust and maintainable (272033e) 839 o Restore fast-path event_reinit() for slower backends (2c4b5de) 840 o Check changelist as part of checking representational integrity (39b3f38) 841 o Fix a compile warning in event_reinit (e4a56ed Sebastian Hahn) 842 o Refactor the functions that run over every event. (c89b4e6) 843 o Remove the last vestiges of _EVENT_USE_EVENTLIST (a3cec90) 844 o Make event-config.h depend on Makefile.am (2958a5c) 845 846 Build fixes: 847 o Don't do clang version detection when disabling some flags (083296b 848 Sebastian Hahn) 849 850 C standards conformance: 851 o Check for NULL return on win32 mm_calloc, and set ENOMEM. (af7ba69) 852 o Convert event-config.h macros to avoid reserved identifiers (68120d9) 853 o Generate event-config.h using the correct macros. (f82c57e) 854 o Convert include-guard macro convention to avoid reserved identifiers 855 (3f8c7cd) 856 o Make event_rpcgen.py output conform to identifier conventions (372bff1) 857 o Stop referring to an obsolete include guard in bench_http.h (5c0f7e0) 858 o Make the generated event-config.h use correct include guards (639383a) 859 o Fix all identifiers with names beginning with underscore. (cb9da0b) 860 o Make event_rpcgen.py output conform to identifier conventions, more 861 (bcefd24) 862 o Fix some problems introduced by automated identifier cleanup script 863 (c963534) 864 o Have all visible internal function names end with an underscore. (8ac3c4c) 865 o Apply the naming convention to our EVUTIL_IS* functions (c7848fa) 866 o Clean up lingering _identifiers. (946b584) 867 o Fix doxygen to use new macro conventions (da455e9) 868 869 Bugfixes: 870 o Do not use system EAI/AI values if we are not using the system 871 getaddrinfo. (7bcac07) 872 873 Sample Code: 874 o Fix up sample/event-test.c to use newer interfaces and make it 875 actually work. (19bab4f Ross Lagerwall) 876 o On Unix, remove event.fifo left by sample/event-test.c. (c0dacd2 Ross 877 Lagerwall) 878 o Rename event-test.c to event-read-fifo.c. (a5b370a Ross Lagerwall) 879 o event-read-fifo: Use EV_PERSIST appropriately (24dab0b) 880 881 882 883 884