From 6511b6dd5d892f121954b34a1fcff3c6c929665c Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Tue, 6 Jun 2023 18:48:45 -0300 Subject: [PATCH] comment --- mongoose.h | 5 ++++- src/net_rl.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) 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