o Add an evdns_getaddrinfo() function to provide a nonblocking getaddrinfo using evdns, so programs can perform useful hostname lookup.
o Finally expose the IOCP-based bufferevent backend. It passes its unit tests, but probably still has some bugs remaining. Code by Nick Mathewson and Christopher Davis.
o Numerous other bugfixes.
-
+ o On FreeBSD and other OSes, connect can return ECONREFUSED immediately; instead of failing the function call, pretend with faileld in the callback.
Changes in 2.0.2-alpha:
o Add a new flag to bufferevents to make all callbacks automatically deferred.
if (socket_connect(evcon->fd, evcon->address, evcon->port) == -1) {
event_sock_warn(evcon->fd, "%s: connection to \"%s\" failed",
__func__, evcon->address);
- EVUTIL_CLOSESOCKET(evcon->fd); evcon->fd = -1;
- return (-1);
+ /* some operating systems return ECONNREFUSED immediately
+ * when connecting to a local address. the cleanup is going
+ * to reschedule this function call.
+ */
+ evhttp_connection_cb_cleanup(evcon);
+ return (0);
}
/* Set up a callback for successful connection setup */