commit 2eff884: [Minor] Terminate milter session on IO errors
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Nov 22 15:56:06 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-11-22 15:49:28 +0000
URL: https://github.com/rspamd/rspamd/commit/2eff88401aaac1a94a6e97ffdfdd1aaa7f53c041 (HEAD -> master)
[Minor] Terminate milter session on IO errors
Issue: #3149
---
src/libserver/milter.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
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 {
More information about the Commits
mailing list