mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 23:49:44 +08:00
Fix unintended socket close on systems with valid fd=0 descriptor numbering
This commit is contained in:
parent
4271aa5b1f
commit
51c51d49ad
@ -3432,6 +3432,7 @@ struct mg_connection *mg_connect(struct mg_mgr *mgr, const char *url,
|
||||
} else {
|
||||
LIST_ADD_HEAD(struct mg_connection, &mgr->conns, c);
|
||||
c->is_udp = (strncmp(url, "udp:", 4) == 0);
|
||||
c->fd = (void *) (size_t) -1; // Set to INVALID_SOCKET
|
||||
c->fn = fn;
|
||||
c->is_client = true;
|
||||
c->fn_data = fn_data;
|
||||
|
@ -174,6 +174,7 @@ struct mg_connection *mg_connect(struct mg_mgr *mgr, const char *url,
|
||||
} else {
|
||||
LIST_ADD_HEAD(struct mg_connection, &mgr->conns, c);
|
||||
c->is_udp = (strncmp(url, "udp:", 4) == 0);
|
||||
c->fd = (void *) (size_t) -1; // Set to INVALID_SOCKET
|
||||
c->fn = fn;
|
||||
c->is_client = true;
|
||||
c->fn_data = fn_data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user