diff --git a/WIN32-Code/event2/event-config.h b/WIN32-Code/event2/event-config.h index c7f09ff2..93b590a9 100644 --- a/WIN32-Code/event2/event-config.h +++ b/WIN32-Code/event2/event-config.h @@ -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 header file. */ /* #undef _EVENT_HAVE_SYS_DEVPOLL_H */ diff --git a/bufferevent_async.c b/bufferevent_async.c index c00ade89..e4fde1f6 100644 --- a/bufferevent_async.c +++ b/bufferevent_async.c @@ -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); diff --git a/configure.in b/configure.in index 462c0346..f9bef8a8 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/test/regress_http.c b/test/regress_http.c index 62516b60..95511ae9 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -27,6 +27,7 @@ #ifdef WIN32 #include +#include #include #endif