commit 72d02aa5b1118849008b656bdbb4f08804289f33
Author: FRIGN <[email protected]>
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
@@ -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));


Reply via email to