Browse files

Update to levent 2.0.9-rc

  • Loading branch information...
1 parent ce35364 commit d34cc3bc6cc338c12be285574b5df00b0f8d718f @jedisct1 committed Nov 30, 2010
@@ -1,5 +1,123 @@
-Changes in 2.0.9-(rc/stable) (?? Nov/Dec 2010):
- [Not released yet; see the git log for now.]
+Changes in version 2.0.10 (?? Dec 2010)
+ [Not yet released; see Git log for more info]
+Changes in 2.0.9-rc (30 Nov 2010):
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+ o Add a function to change a listener's callback. (46ee061)
+ o Make evbuffer_add_file take ev_off_t, not off_t (ac7e52d)
+ o Make rate-limits go up to SIZE_MAX/EV_SSIZE_MAX, not just INT32_MAX (2cbb1a1)
+ o Add a bufferevent_get_base function (aab49b6)
+ o Disable changelist for epoll by default because of Linux dup() bug; add an option and/or an envvar to reenable it for speed. (9531763)
+ o Fix a 100%-CPU bug where an SSL connection would sometimes never stop trying to write (1213d3d)
+ o Fix a nasty bug related to use of dup() with epoll on Linux (c281aba)
+ o Fix bugs in posix thread-id calculation when sizeof(pthread_t) != sizeof(long) (fbaf077)
+ o Fix some ints to evutil_socket_t; make tests pass on win64. (f817bfa Dimitre Piskyulev)
+ o Set _EVENT_SIZEOF_VOID_P correctly on win32 and win64 (1ae82cd Dimitre Piskyulev)
+ o Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL (abf01ed)
+ o Set SO_UPDATE_ACCEPT_CONTEXT on sockets from AcceptEx so that shutdown() can work (52aa419)
+ o When closing a filtering bufferevent, clear callbacks on the underlying bufferevent (fc7b1b0)
+ o Add evhttp_parse_query_str to be used with evhttp_uri_parse. (2075fbc)
+ o Add evhttp_response_code to remove one more reason to include http_struct.h (22e0a9b)
+ o Define enumerators for all HTTP methods, including PATCH from RFC5789 (75a7341 Felix Nawothnig)
+ o Functions to actually use evhttp_bound_socket with/as evconnlistener. (006efa7)
+ o Add evhttp_request_get_command so code can tell GET from POST without peeking at the struct. (49f4bf7)
+ o Introduce absolute URI parsing helpers. (86dd720 Pavel Plesov)
+ o Revise evhttp_uri_parse implementation to handle more of RFC3986 (eaa5f1d)
+ o Add evhttp_connection_get_base() to get the event_base from an http connection (cd00079)
+ o Let evhttp_parse_query return -1 on failure (b1756d0)
+ o New evhttp_uri(encode|decode) functions to handle + and NUL characters right (a8148ce)
+ o Add evhttp_response_code to remove one more reason to include http_struct.h (22e0a9b)
+ o Tweak interface for allowed methods (f5b391e)
+ o Add evhttp server alias interface, correct flagging of proxy requests. (aab8c38 Christopher Davis)
+ o Add some comments to http.c and make a few functions static. (90b3ed5)
+ o Fix Content-Length when trying send more than 100GB of data (!) on an evhttp. (525da3e)
+ o Fix a bug where we would read too much data in HTTP bodies or requests. (58a1cc6)
+ o Correctly count req->body_size on http usage without Content-Length (8e342e5)
+ o Avoid missed-request bug when entire http request arrives before data is flushed (74c0e86)
+ o reset "chunked" flag when sending non-chunked reply (aa5f55f Joachim Bauch)
+ o evhttp_encode_uri encodes all reserved characters, including !$'()*+,/:=@ (2e63a60)
+ o Replace exact-version checks for HTTP/1.1 with >= or < checks (647e094)
+ o evhttp: Return 501 when we get an unrecognized method, not 400. (536311a)
+ o Don't disable reading from the HTTP connection after sending the request to be notified of connection-close in time (c76640b Felix Nawothnig)
+ o Never call evhttp_readcb while writing. (0512487)
+ o Try to fix an assertion failure related to close detection (0faaa39)
+ o Correctly detect timeouts during http connects (04861d5)
+ o Preliminary support for Continue expectation in evhttp. (fa9305f Christopher Davis)
+ o Correct logic for realigning a chain in evbuffer_add (e4f34e8)
+ o Fix a minor syntax error that most compilers didn't care about (e56ff65)
+ o Fix some uses of int for socket in regress (5d389dc)
+ o Check return value for ioctlsocket on win32 (f5ad31c Trond Norbye)
+ o Fix som event_warns that should have been event_warnx (19c71e7)
+ o Fix signal handler types for win64. (b81217f)
+ o Try to clear up more size_t vs int/long issues. (598d133)
+ o Make sure IOCP evconnlistener uses virtual events. (7b40a00 Christopher Davis)
+ o Don't free evdns_request handles until after the callback is invoked (9ed30de)
+ o Fix some more cancel-related bugs in getaddrinfo_async (c7cfbcf)
+ o Make evdns_getaddrinfo_cancel threadsafe (d51b2fc)
+ o Only clear underlying callbacks when the user hasn't reset them. (1ac5b23)
+ o Fix bug in bufferevent_connect on an openssl bufferevent that already had an fd (4f228a1)
+ o Resolve an evport bug in the thread/forking test (3a67d0b)
+ o Make sure the CLOEXEC flag is set on fds we open for base notification (3ab578f)
+ o Fix IRIX build. sa_family collides with a #define in sys/socket.h on IRIX. (e874982 Kevin Bowling)
+ o If not WIN32, include <sys/socket.h> in event2/util.h. (1cd45e5 Kevin Bowling)
+ o Fix some C99-style comments to work with the xlC compiler. (c2e5e22 Kevin Bowling)
+ o Add some checks since lack of TAILQ_FOREACH doesn't imply lack of FIRST, END, NEXT, or INSERT_BEFORE. Quiet some warnings in XL C. (c4dc335 Kevin Bowling)
+ o Reworked AIX __ss_family workaround to use AC_STRUCT_MEMBER. (2e2a3d7 Kevin Bowling)
+ o Take select from <sys/select.h> when testing in autoconf. AIX build fix. (a3a9f6b Kevin Bowling)
+ o Fix snprintf related failures on IRIX. (3239073 Kevin Bowling)
+ o Remove _event_initialized(); make event_initialized() a function(); make it consistent on windows and non-windows (652024b)
+ o Do not let EVLOOP_ONCE exit the loop until all deferred callbacks have run (2d5e1bd)
+ o Make EVLOOP_ONCE ignore internal events (0617a81)
+ o Possible crash fix when freeing an underlying bufferevent of an openssl bufferevent (29f7623)
+ o Stop using Libevent-1 headers in regress_http (1f507d7)
+ o Modernize header usage in bench_http.c (e587069)
+ o fix signed/unsigned warnings in http.c (74a91e5)
+ o Update the HTTP regression tests to use Libevent2 apis for non-http stuff (d9ffa89)
+ o Start porting http tests to not use legacy interfaces (8505a74)
+ o Convert the rest of the http tests to be non-legacy unit tests. (9bb8239)
+ o Rename the confusing "base" static variable in regress_http.c (353402a)
+ o Stop accessing http request struct directly from in the unit tests. (0b137f4)
+ o Refactor http version parsing into a single function (a38140b)
+ o Improvements to tinytest_macros.h (ad923a1)
+ o Add a huge pile of tests for the new URI functions, and make them pass. (a5a76e6)
+ o Unit tests for evhttp_uri_set* (bc98f5e)
+ o Increase the skew tolerance to 2 seconds in thread/deferred_cb_skew (f806476 Christopher Davis)
+ o Reorder backends in to match preference order in event.c (ece974f)
+ o Add a stress test for getaddrinfo_cancel (da1bf52)
+ o Units test for unexpected evhttp methods. (75e3320)
+ o Document behavior of URI parsing more thoroughly. (3a33462)
+ o Document that two bufferevent functions only work on socket bufferevents (70e1b60)
+ o add a requested docstring for event_rpcgen.CommandLine.__init__ (f1250eb)
+ o Fix a mistake in http documentation found by Julien Blache (229714d)
+ o Add a basic example of how to write a static HTTP server. (4e794d5)
+ o Document event_get_assignment (88be27d)
+ o Note that reentrant calls to libevent from logging cbs may fail badly (e431bcd)
+ o Clarify EVLOOP_* documentation to be more precise. (057a514)
+ o Simplify the logic for choosing EPOLL_CTL_ADD vs EPOLL_CTL_MOD (2c66983)
+ o Rename "size" variables in win32select that were really fd counts. (b6a158c)
+ o Fix even more win64 warnings (7484df6)
+ o Fix even more win64 warnings: buffer, event_tagging, http, evdns, evrpc (545a611)
+ o Fix more wn64 warnings. (34b84b9 Christopher Davis)
+ o Use the label_len local variable in evdns instead of recalculating it over and over (ba01456)
+ o Fix some irix compilation warnings spotted by Kevin Bowling (7bcace2)
@@ -34,7 +34,7 @@ RELEASE = -release 2.0
# 2.0.1-alpha -- 2.0 1:0:0
@@ -45,9 +45,11 @@ VERSION_INFO = 4:0:2
# 2.0.6-rc -- 2.0 2:0:0
# 2.0.7-rc -- 2.0 3:0:1
# 2.0.8-rc -- 2.0 4:0:2
+# 2.0.9-rc -- 2.0 5:0:0 (ABI changed slightly)
# Planned:
-# 2.0.9-stable-- 2.0 5:0:0 (ABI changed slightly)
+# 2.0.10-stable-- 2.0 6:0:1 if the ABI changes compatibly,
+# or 5:1:0 if the ABI does not change,
+# or 6:0:0 if the ABI breaks
# For Libevent 2.1:
# 2.1.1-alpha -- 2.1 1:0:0
@@ -74,17 +74,22 @@ fixing bugs:
Weston Andros Adamson
William Ahern
+ Ivan Andropov
Avi Bab
Gilad Benjamini
Stas Bekman
Joachim Bauch
+ Denis Bilenko
+ Julien Blache
+ Kevin Bowling
Ralph Castain
Shuo Chen
Ka-Hing Cheung
Andrew Danforth
Christopher Davis
Mike Davis
Mihai Draghicioiu
+ Mark Ellzey
Shie Erlich
Alexander von Gernler
Artur Grabowski
@@ -102,6 +107,7 @@ fixing bugs:
Philip Lewis
Zhou Li
David Libenzi
+ Yan Lin
Moshe Litvin
Hagne Mahre
Lubomir Marinov
@@ -110,8 +116,10 @@ fixing bugs:
Nicholas Marriott
Andrey Matveev
Caitlin Mercer
+ Dagobert Michelsen
Felix Nawothnig
Trond Norbye
+ Linus Nordberg
Richard Nyberg
Jon Oberheide
Phil Oleson
@@ -120,6 +128,8 @@ fixing bugs:
Simon Perreault
Pierre Phaneuf
Ryan Phillips
+ Dimitre Piskyulev
+ Pavel Plesov
Jon Poland
Bert JW Regeer
Hanna Schroeter
@@ -130,6 +140,7 @@ fixing bugs:
Dug Song
Brodie Thiesfield
Jason Toffaletti
+ Bas Verhoeven
Zack Weinberg
@@ -274,7 +274,7 @@
/* Numeric representation of the version */
-#define _EVENT_NUMERIC_VERSION 0x02000801
+#define _EVENT_NUMERIC_VERSION 0x02000901
/* Name of package */
#define _EVENT_PACKAGE "libevent"
@@ -317,14 +317,21 @@
+/* The size of `void *', as computed by sizeof. */
+#ifdef _WIN64
/* Define to 1 if you have the ANSI C header files. */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* Version number of package */
-#define _EVENT_VERSION "2.0.8-rc-dev"
+#define _EVENT_VERSION "2.0.9-rc-dev"
/* Define to appropriate substitue if compiler doesnt have __func__ */
#define _EVENT___func__ __FUNCTION__
@@ -525,10 +525,10 @@ conn_closed(struct bufferevent_openssl *bev_ssl, int errcode, int ret)
if (dirty_shutdown && bev_ssl->allow_dirty_shutdown)
event = BEV_EVENT_EOF;
- _bufferevent_run_eventcb(&bev_ssl->bev.bev, event);
+ _bufferevent_run_eventcb(&bev_ssl->bev.bev, event);
static void
@@ -5,9 +5,9 @@ AC_INIT(event.c)
-AC_DEFINE(NUMERIC_VERSION, 0x02000801, [Numeric representation of the version])
+AC_DEFINE(NUMERIC_VERSION, 0x02000901, [Numeric representation of the version])
dnl Initialize prefix.
if test "$prefix" = "NONE"; then
@@ -432,8 +432,8 @@ AC_CHECK_TYPES([fd_mask], , ,
#include <sys/types.h>
-#include <select.h>
+#include <sys/select.h>
AC_CHECK_SIZEOF(long long)
@@ -470,7 +470,7 @@ AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrin
-AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct sockaddr_in.sin_len, struct sockaddr_in6.sin6_len], , ,
+AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct sockaddr_in.sin_len, struct sockaddr_in6.sin6_len, struct sockaddr_storage.ss_family, struct sockaddr_storage.__ss_family], , ,
[#include <sys/types.h>
#include <netinet/in.h>
@@ -529,6 +529,10 @@ if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then
[Define if we have pthreads on this system])
+ AC_CHECK_SIZEOF(pthread_t, ,
+ #include <pthread.h> ]
+ )
AM_CONDITIONAL(PTHREADS, [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"])
@@ -377,6 +377,29 @@ evhttp_write_buffer(struct evhttp_connection *evcon,
+static void
+evhttp_send_continue_done(struct evhttp_connection *evcon, void *arg)
+ bufferevent_disable(evcon->bufev, EV_WRITE);
+static void
+evhttp_send_continue(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+ bufferevent_enable(evcon->bufev, EV_WRITE);
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
+ "HTTP/%d.%d 100 Continue\r\n\r\n",
+ req->major, req->minor);
+ evcon->cb = evhttp_send_continue_done;
+ evcon->cb_arg = NULL;
+ bufferevent_setcb(evcon->bufev,
+ evhttp_read_cb,
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
/** Helper: returns true iff evconn is in any connected state. */
static int
evhttp_connected(struct evhttp_connection *evcon)
@@ -574,6 +597,9 @@ evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req)
* For a request, we add the POST data, for a reply, this
* is the regular data.
+ /* XXX We might want to support waiting (a limited amount of
+ time) for a continue status line from the server before
+ sending POST/PUT message bodies. */
evbuffer_add_buffer(output, req->output_buffer);
@@ -1159,6 +1185,8 @@ evhttp_connection_start_detectclose(struct evhttp_connection *evcon)
static void
evhttp_connection_stop_detectclose(struct evhttp_connection *evcon)
+ evcon->flags &= ~EVHTTP_CON_CLOSEDETECT;
bufferevent_disable(evcon->bufev, EV_READ);
@@ -1205,7 +1233,7 @@ evhttp_error_cb(struct bufferevent *bufev, short what, void *arg)
switch (evcon->state) {
- if (what == BEV_EVENT_TIMEOUT) {
+ if (what & BEV_EVENT_TIMEOUT) {
event_debug(("%s: connection timeout for \"%s:%d\" on %d",
__func__, evcon->address, evcon->port,
@@ -1806,6 +1834,30 @@ evhttp_get_body(struct evhttp_connection *evcon, struct evhttp_request *req)
+ /* Should we send a 100 Continue status line? */
+ if (req->kind == EVHTTP_REQUEST && REQ_VERSION_ATLEAST(req, 1, 1)) {
+ const char *expect;
+ expect = evhttp_find_header(req->input_headers, "Expect");
+ if (expect) {
+ if (!evutil_ascii_strcasecmp(expect, "100-continue")) {
+ /* XXX It would be nice to do some sanity
+ checking here. Does the resource exist?
+ Should the resource accept post requests? If
+ no, we should respond with an error. For
+ now, just optimistically tell the client to
+ send their message body. */
+ if (!evbuffer_get_length(bufferevent_get_input(evcon->bufev)))
+ evhttp_send_continue(evcon, req);
+ } else {
+ evhttp_send_error(req, HTTP_EXPECTATIONFAILED,
+ NULL);
+ return;
+ }
+ }
+ }
evhttp_read_body(evcon, req);
/* note the request may have been freed in evhttp_read_body */
@@ -1863,6 +1915,11 @@ evhttp_read_header(struct evhttp_connection *evcon,
+ /* Start over if we got a 100 Continue response. */
+ if (req->response_code == 100) {
+ evhttp_start_read(evcon);
+ return;
+ }
if (!evhttp_response_needs_body(req)) {
event_debug(("%s: skipping body for code %d\n",
__func__, req->response_code));
Oops, something went wrong.

0 comments on commit d34cc3b

Please sign in to comment.