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.
This commit is contained in:
parent
8fdfa36914
commit
72d02aa5b1
1 changed files with 1 additions and 1 deletions
2
quark.c
2
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 (; (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);
|
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));
|
logerrmsg("error writing to client %s: %s\n", host, strerror(errno));
|
||||||
if (n == -1)
|
if (n == -1)
|
||||||
logerrmsg("error reading from file: %s\n", strerror(errno));
|
logerrmsg("error reading from file: %s\n", strerror(errno));
|
||||||
|
|
Loading…
Reference in a new issue