1 From 25028730cd1b76e373ff989625132d526eea2504 Mon Sep 17 00:00:00 2001
2 From: Timo Sirainen <timo.sirainen@open-xchange.com>
3 Date: Mon, 15 Jul 2019 10:14:23 +0300
4 Subject: [PATCH] lib: ostream-file: Don't log any errors when setting
7 It's likely never useful to log the error, and it seems more and more
8 unexpected errors just keep popping up.
10 src/lib/ostream-file.c | 18 +++++++++---------
11 1 file changed, 9 insertions(+), 9 deletions(-)
13 diff --git a/src/lib/ostream-file.c b/src/lib/ostream-file.c
14 index e7e6f62d12..82bf729ac0 100644
15 --- a/src/lib/ostream-file.c
16 +++ b/src/lib/ostream-file.c
17 @@ -333,17 +333,17 @@ static int buffer_flush(struct file_ostream *fstream)
18 static void o_stream_tcp_flush_via_nodelay(struct file_ostream *fstream)
20 if (net_set_tcp_nodelay(fstream->fd, TRUE) < 0) {
21 - if (errno != ENOTSUP && errno != ENOTSOCK &&
22 - errno != ENOPROTOOPT) {
23 - i_error("file_ostream.net_set_tcp_nodelay(%s, TRUE) failed: %m",
24 - o_stream_get_name(&fstream->ostream.ostream));
26 + /* Don't bother logging errors. There are quite a lot of
27 + different errors that need to be ignored, and it differs
28 + between OSes. At least:
29 + Linux: ENOTSUP, ENOTSOCK, ENOPROTOOPT
30 + FreeBSD: EINVAL, ECONNRESET */
31 fstream->no_socket_nodelay = TRUE;
32 } else if (net_set_tcp_nodelay(fstream->fd, FALSE) < 0) {
33 - /* We already successfully enabled TCP_NODELAY, so we're really
34 - not expecting any errors here. */
35 - i_error("file_ostream.net_set_tcp_nodelay(%s, FALSE) failed: %m",
36 - o_stream_get_name(&fstream->ostream.ostream));
37 + /* We already successfully enabled TCP_NODELAY, so there
38 + shouldn't really be errors. Except ECONNRESET can possibly
39 + still happen between these two calls, so again don't log
41 fstream->no_socket_nodelay = TRUE;