[hackers] [quark] Ignore EPIPE while writing file to socket || FRIGN
commit 72d02aa5b1118849008b656bdbb4f08804289f33
Author: FRIGN <dev_AT_frign.de>
Date: Thu Aug 14 13:14:08 2014 +0200
Ignore EPIPE while writing file to socket
If the client decides not to listen, it's not that much of a problem.
Don't flood the logs with "Broken pipe"-messages by silently letting
this "error" pass.
diff --git a/quark.c b/quark.c
index a9d32ec..121ecee 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -189,7 +189,7 @@ responsefiledata(int fd, off_t size) {
for (; (n = read(fd, buf, MIN(size, sizeof buf))) > 0; size -= n)
for(size_in = n; (m = write(req.fd, buf, size_in)) > 0; size_in -= m);
- if (m == -1)
+ if (m == -1 && errno != EPIPE)
logerrmsg("error writing to client %s: %s
", host, strerror(errno));
if (n == -1)
logerrmsg("error reading from file: %s
", strerror(errno));
Received on Thu Aug 14 2014 - 13:13:15 CEST
This archive was generated by hypermail 2.3.0
: Thu Aug 14 2014 - 13:24:08 CEST