From: Philip Hazel Date: Tue, 5 Sep 2006 14:14:32 +0000 (+0000) Subject: Ignore EPIPE as well as ECONNECT when closing down an SMTP session in X-Git-Tag: exim-4_64~91 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/1f872c8094ff0e34fa7ea404995fc51ba9995674 Ignore EPIPE as well as ECONNECT when closing down an SMTP session in the daemon, since dropped connections can show as EPIPE in Solaris. --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 6e70b4f13..9091f0d86 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.387 2006/09/05 13:24:10 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.388 2006/09/05 14:14:32 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -23,6 +23,14 @@ PH/01 If a server that rejects MAIL FROM:<> was the target of a sender left unchanged (for any other kind of callout, getting as far as trying RCPT means that the domain itself is ok). +PH/02 Tidied a number of unused variable and signed/unsigned warnings that + gcc 4.1.1 threw up. + +PH/03 On Solaris, an unexpectedly close socket (dropped connection) can + manifest itself as EPIPE rather than ECONNECT. When tidying away a + session, the daemon ignores ECONNECT errors and logs others; it now + ignores EPIPE as well. + Exim version 4.63 ----------------- diff --git a/src/src/daemon.c b/src/src/daemon.c index f1912c40f..1311d711c 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/daemon.c,v 1.15 2006/02/22 14:46:44 ph10 Exp $ */ +/* $Cambridge: exim/src/src/daemon.c,v 1.16 2006/09/05 14:14:32 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -680,13 +680,14 @@ ERROR_RETURN: /* Close the streams associated with the socket which will also close the socket fds in this process. We can't do anything if fclose() fails, but logging brings it to someone's attention. However, "connection reset by peer" -isn't really a problem, so skip that one. If the streams don't exist, something -went wrong while setting things up. Make sure the socket descriptors are -closed, in order to drop the connection. */ +isn't really a problem, so skip that one. On Solaris, a dropped connection can +manifest itself as a broken pipe, so drop that one too. If the streams don't +exist, something went wrong while setting things up. Make sure the socket +descriptors are closed, in order to drop the connection. */ if (smtp_out != NULL) { - if (fclose(smtp_out) != 0 && errno != ECONNRESET) + if (fclose(smtp_out) != 0 && errno != ECONNRESET && errno != EPIPE) log_write(0, LOG_MAIN|LOG_PANIC, "daemon: fclose(smtp_out) failed: %s", strerror(errno)); smtp_out = NULL; @@ -695,7 +696,7 @@ else (void)close(accept_socket); if (smtp_in != NULL) { - if (fclose(smtp_in) != 0 && errno != ECONNRESET) + if (fclose(smtp_in) != 0 && errno != ECONNRESET && errno != EPIPE) log_write(0, LOG_MAIN|LOG_PANIC, "daemon: fclose(smtp_in) failed: %s", strerror(errno)); smtp_in = NULL;