diff --git a/mongoose.h b/mongoose.h index 59051fa2..43737085 100644 --- a/mongoose.h +++ b/mongoose.h @@ -629,7 +629,10 @@ struct timeval { #define MG_SOCK_RESET(errcode) \ ((errcode) == BSD_ECONNABORTED || (errcode) == BSD_ECONNRESET) -#define MG_SOCK_INTR(fd) 0 +// In blocking mode, which is enabled by default, accept() waits for a +// connection request. In non blocking mode, you must call accept() +// again if the error code BSD_EWOULDBLOCK is returned. +#define MG_SOCK_INTR(fd) (fd == BSD_EWOULDBLOCK) #define socklen_t int #endif diff --git a/src/net_rl.h b/src/net_rl.h index d731b295..6953a5ec 100644 --- a/src/net_rl.h +++ b/src/net_rl.h @@ -16,6 +16,9 @@ #define MG_SOCK_RESET(errcode) \ ((errcode) == BSD_ECONNABORTED || (errcode) == BSD_ECONNRESET) +// In blocking mode, which is enabled by default, accept() waits for a +// connection request. In non blocking mode, you must call accept() +// again if the error code BSD_EWOULDBLOCK is returned. #define MG_SOCK_INTR(fd) (fd == BSD_EWOULDBLOCK) #define socklen_t int