From 72d02aa5b1118849008b656bdbb4f08804289f33 Mon Sep 17 00:00:00 2001 From: FRIGN Date: Thu, 14 Aug 2014 13:14:08 +0200 Subject: [PATCH] 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. --- quark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quark.c b/quark.c index a9d32ec..121ecee 100644 --- a/quark.c +++ b/quark.c @@ -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\n", host, strerror(errno)); if (n == -1) logerrmsg("error reading from file: %s\n", strerror(errno));