struct event_iocp_port *port;
short n_accepting;
short shutting_down;
+ short enabled;
struct accepting_socket **accepting;
};
#endif
DWORD pending = 0;
SOCKET s = socket(as->family, SOCK_STREAM, 0);
int error = 0;
+
+ if (!as->lev->enabled)
+ return 0;
+
if (s == INVALID_SOCKET) {
error = WSAGetLastError();
goto report_err;
EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
LOCK(lev);
+ lev_iocp->enabled = 1;
for (i = 0; i < lev_iocp->n_accepting; ++i) {
struct accepting_socket *as = lev_iocp->accepting[i];
if (!as)
EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
LOCK(lev);
+ lev_iocp->enabled = 0;
for (i = 0; i < lev_iocp->n_accepting; ++i) {
struct accepting_socket *as = lev_iocp->accepting[i];
if (!as)
lev->port = event_base_get_iocp(base);
lev->fd = fd;
lev->event_base = base;
+ lev->enabled = 1;
if (event_iocp_port_associate(lev->port, fd, 1) < 0)
goto err_free_lev;
&basic_setup, NULL},
{ "error", regress_listener_error,
- TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR|TT_ENABLE_IOCP
- |TT_SKIP/*Remove once err-handling on IOCP listeners is ok*/,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR|TT_ENABLE_IOCP,
&basic_setup, NULL},
END_OF_TESTCASES,