]> git.ipfire.org Git - people/ms/dma.git/commitdiff
Close connections on failure
authorduraseb <sszulc@gmail.com>
Thu, 19 Nov 2015 08:43:35 +0000 (09:43 +0100)
committerduraseb <sszulc@gmail.com>
Tue, 22 Mar 2016 10:31:51 +0000 (11:31 +0100)
net.c

diff --git a/net.c b/net.c
index 26935a8feec8306bf6b5f7be7daa563e0c9cabd6..47ee928494215be68c5dec48ee04cb2ce95da9a2 100644 (file)
--- a/net.c
+++ b/net.c
@@ -372,11 +372,13 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host)
                       host->host, host->addr, c, neterr); \
                snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \
                         host->host, host->addr, c, neterr); \
-               return (-1); \
+               error = -1; \
+               goto out; \
        } else if (res != exp) { \
                syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \
                       host->host, host->addr, c, neterr); \
-               return (1); \
+               error = 1; \
+               goto out; \
        }
 
        /* Check first reply from remote host */
@@ -426,7 +428,8 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host)
                        syslog(LOG_ERR, "remote delivery failed:"
                                        " SMTP login failed: %m");
                        snprintf(errmsg, sizeof(errmsg), "SMTP login to %s failed", host->host);
-                       return (-1);
+                       error = -1;
+                       goto out;
                }
                /* SMTP login is not available, so try without */
                else if (error > 0) {