mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-15 10:29:47 +00:00
add_to_set(): fix around non-negative SOCKET on Windows
This commit is contained in:
1 parent
9bbf4c8384
commit
107902bae4
1 file changed
+5
-3
+5
-3
@@ -741,9 +741,11 @@ int ns_send(struct ns_connection *conn, const void *buf, int len) {
|
||||
}
|
||||
|
||||
static void add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) {
|
||||
if (sock >= 0) FD_SET(sock, set);
|
||||
if (sock > *max_fd) {
|
||||
*max_fd = sock;
|
||||
if (sock != INVALID_SOCKET) {
|
||||
FD_SET(sock, set);
|
||||
if (*max_fd == INVALID_SOCKET || sock > *max_fd) {
|
||||
*max_fd = sock;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user