Merge remote-tracking branch 'origin/patches-2.0'

This commit is contained in:
Nick Mathewson 2011-04-23 02:31:59 -04:00
commit 18f24ef4d5
4 changed files with 14 additions and 1 deletions

View File

@ -192,6 +192,9 @@
/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
#define _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE 1
/* Define to 1 if you have the <sys/devpoll.h> header file. */
/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */

View File

@ -64,6 +64,11 @@
#include "util-internal.h"
#include "iocp-internal.h"
#ifndef SO_UPDATE_CONNECT_CONTEXT
/* Mingw is sometimes missing this */
#define SO_UPDATE_CONNECT_CONTEXT 0x7010
#endif
/* prototypes */
static int be_async_enable(struct bufferevent *, short);
static int be_async_disable(struct bufferevent *, short);
@ -404,11 +409,15 @@ connect_complete(struct event_overlapped *eo, ev_uintptr_t key,
{
struct bufferevent_async *bev_a = upcast_connect(eo);
struct bufferevent *bev = &bev_a->bev.bev;
evutil_socket_t sock;
BEV_LOCK(bev);
EVUTIL_ASSERT(bev_a->bev.connecting);
bev_a->bev.connecting = 0;
sock = _evbuffer_overlapped_get_fd(bev_a->bev.bev.input);
/* XXXX Handle error? */
setsockopt(sock, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0);
if (ok)
bufferevent_async_set_connected(bev);

View File

@ -88,7 +88,7 @@ AC_SUBST(LIBTOOL_DEPS)
AM_CONDITIONAL([BUILD_REGRESS], [test "$enable_libevent_regress" = "yes"])
if test "$enable_libevent_regress" = "yes" ; then
CHECK_REGRESS=regress
CHECK_REGRESS='regress$(EXEENT)'
else
CHECK_REGRESS=
fi

View File

@ -27,6 +27,7 @@
#ifdef WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#endif