mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-24 02:59:01 +08:00
Properly disable socketpair-related stuff
PUBLISHED_FROM=f3a236470281af80848c8f78163980083190c081
This commit is contained in:
parent
845d751e87
commit
547ec85b58
@ -1925,7 +1925,9 @@ void mg_close_conn(struct mg_connection *conn) {
|
||||
|
||||
void mg_mgr_init(struct mg_mgr *m, void *user_data) {
|
||||
memset(m, 0, sizeof(*m));
|
||||
#ifndef MG_DISABLE_SOCKETPAIR
|
||||
m->ctl[0] = m->ctl[1] = INVALID_SOCKET;
|
||||
#endif
|
||||
m->user_data = user_data;
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -1989,8 +1991,8 @@ void mg_mgr_free(struct mg_mgr *m) {
|
||||
#ifndef MG_DISABLE_SOCKETPAIR
|
||||
if (m->ctl[0] != INVALID_SOCKET) closesocket(m->ctl[0]);
|
||||
if (m->ctl[1] != INVALID_SOCKET) closesocket(m->ctl[1]);
|
||||
#endif
|
||||
m->ctl[0] = m->ctl[1] = INVALID_SOCKET;
|
||||
#endif
|
||||
|
||||
for (conn = m->active_connections; conn != NULL; conn = tmp_conn) {
|
||||
tmp_conn = conn->next;
|
||||
@ -3367,7 +3369,9 @@ time_t mg_mgr_poll(struct mg_mgr *mgr, int milli) {
|
||||
FD_ZERO(&read_set);
|
||||
FD_ZERO(&write_set);
|
||||
FD_ZERO(&err_set);
|
||||
#ifndef MG_DISABLE_SOCKETPAIR
|
||||
mg_add_to_set(mgr->ctl[1], &read_set, &max_fd);
|
||||
#endif
|
||||
|
||||
for (nc = mgr->active_connections, num_fds = 0; nc != NULL; nc = tmp) {
|
||||
tmp = nc->next;
|
||||
|
@ -706,9 +706,11 @@ typedef void (*mg_event_handler_t)(struct mg_connection *, int ev, void *);
|
||||
struct mg_mgr {
|
||||
struct mg_connection *active_connections;
|
||||
const char *hexdump_file; /* Debug hexdump file path */
|
||||
sock_t ctl[2]; /* Socketpair for mg_wakeup() */
|
||||
void *user_data; /* User data */
|
||||
void *mgr_data; /* Implementation-specific event manager's data. */
|
||||
#ifndef MG_DISABLE_SOCKETPAIR
|
||||
sock_t ctl[2]; /* Socketpair for mg_wakeup() */
|
||||
#endif
|
||||
void *user_data; /* User data */
|
||||
void *mgr_data; /* Implementation-specific event manager's data. */
|
||||
#ifdef MG_ENABLE_JAVASCRIPT
|
||||
struct v7 *v7;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user