aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/milter.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-22 15:49:28 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-22 15:49:28 +0000
commit2eff88401aaac1a94a6e97ffdfdd1aaa7f53c041 (patch)
treef823d03e2d7a4d4d4a1b3fe99db97b5f88443cb8 /src/libserver/milter.c
parenta342d2a61c6b9f1b213d6ec79edc2f3575d1b43e (diff)
downloadrspamd-2eff88401aaac1a94a6e97ffdfdd1aaa7f53c041.tar.gz
rspamd-2eff88401aaac1a94a6e97ffdfdd1aaa7f53c041.zip
[Minor] Terminate milter session on IO errors
Issue: #3149
Diffstat (limited to 'src/libserver/milter.c')
-rw-r--r--src/libserver/milter.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c
index e97b0381e..1b24fa3da 100644
--- a/src/libserver/milter.c
+++ b/src/libserver/milter.c
@@ -955,6 +955,8 @@ rspamd_milter_handle_session (struct rspamd_milter_session *session,
if (r == -1) {
if (errno == EAGAIN || errno == EINTR) {
rspamd_milter_plan_io (session, priv, EV_READ);
+
+ return TRUE;
}
else {
/* Fatal IO error */
@@ -964,6 +966,10 @@ rspamd_milter_handle_session (struct rspamd_milter_session *session,
priv->err_cb (priv->fd, session, priv->ud, err);
REF_RELEASE (session);
g_error_free (err);
+
+ REF_RELEASE (session);
+
+ return FALSE;
}
}
else if (r == 0) {
@@ -973,6 +979,10 @@ rspamd_milter_handle_session (struct rspamd_milter_session *session,
priv->err_cb (priv->fd, session, priv->ud, err);
REF_RELEASE (session);
g_error_free (err);
+
+ REF_RELEASE (session);
+
+ return FALSE;
}
else {
priv->parser.buf->len += r;
@@ -1023,6 +1033,8 @@ rspamd_milter_handle_session (struct rspamd_milter_session *session,
REF_RELEASE (session);
g_error_free (err);
+ REF_RELEASE (session);
+
return FALSE;
}
}
@@ -1034,6 +1046,8 @@ rspamd_milter_handle_session (struct rspamd_milter_session *session,
REF_RELEASE (session);
g_error_free (err);
+ REF_RELEASE (session);
+
return FALSE;
}
else {