mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-24 20:21:49 +00:00
Using MSG_NOSIGNAL in send()
This commit is contained in:
1 parent
37503c78c8
commit
b78110b92e
1 file changed
+5
-1
+5
-1
@@ -249,6 +249,10 @@ static pthread_t pthread_self(void) {
|
|||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#endif // NO_SOCKLEN_T
|
#endif // NO_SOCKLEN_T
|
||||||
|
|
||||||
|
#if !defined(MSG_NOSIGNAL)
|
||||||
|
#define MSG_NOSIGNAL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*mg_thread_func_t)(void *);
|
typedef void * (*mg_thread_func_t)(void *);
|
||||||
|
|
||||||
static const char *http_500_error = "Internal Server Error";
|
static const char *http_500_error = "Internal Server Error";
|
||||||
@@ -1354,7 +1358,7 @@ static int64_t push(FILE *fp, SOCKET sock, SSL *ssl, const char *buf,
|
|||||||
if (ferror(fp))
|
if (ferror(fp))
|
||||||
n = -1;
|
n = -1;
|
||||||
} else {
|
} else {
|
||||||
n = send(sock, buf + sent, (size_t) k, 0);
|
n = send(sock, buf + sent, (size_t) k, MSG_NOSIGNAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
|
|||||||
Reference in new issue
Block a user