mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 13:04:23 -04:00
On FreeBSD and other OSes, connect can return ECONREFUSED immediately; instead of failing the function call, pretend with faileld in the callback.
svn:r1553
This commit is contained in:
parent
bdfe72f3c5
commit
b8f222e055
@ -51,7 +51,7 @@ Changes in 2.0.3-alpha:
|
||||
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.
|
||||
|
8
http.c
8
http.c
@ -1849,8 +1849,12 @@ evhttp_connection_connect(struct evhttp_connection *evcon)
|
||||
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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user