Creating server ctl socket in a loop to protect from interrupt

This commit is contained in:
Sergey Lyubka 2013-12-21 10:19:12 +00:00
parent 77d5d4c921
commit ec84a148f0

View File

@ -3355,7 +3355,7 @@ struct mg_server *mg_create_server(void *server_data) {
LINKED_LIST_INIT(&server->active_connections);
LINKED_LIST_INIT(&server->uri_handlers);
mg_socketpair(server->ctl);
do { mg_socketpair(server->ctl); } while (server->ctl[0] < 0);
server->server_data = server_data;
server->listening_sock = INVALID_SOCKET;
set_default_option_values(server->config_options);