From: Vsevolod Stakhov Date: Thu, 22 Nov 2018 14:17:33 +0000 (+0000) Subject: [Fix] Emit error if connection has been terminated with no stop pattern X-Git-Tag: 1.8.3~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c249c21fc159451eff0c088ebec00d00dbd3ebaa;p=thirdparty%2Frspamd.git [Fix] Emit error if connection has been terminated with no stop pattern --- diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index b9406111a7..047bfe4446 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -895,7 +895,15 @@ lua_tcp_process_read_handler (struct lua_tcp_cbdata *cbd, else { /* Plan new read */ msg_debug_tcp ("NOT found TCP stop pattern"); - lua_tcp_plan_read (cbd); + + if (!cbd->eof) { + lua_tcp_plan_read (cbd); + } + else { + /* Got session finished but no stop pattern */ + lua_tcp_push_error (cbd, TRUE, + "IO read error: connection terminated"); + } } } } @@ -957,7 +965,7 @@ lua_tcp_process_read (struct lua_tcp_cbdata *cbd, lua_tcp_process_read_handler (cbd, rh, TRUE); } else { - lua_tcp_push_error (cbd, FALSE, "IO read error: connection terminated"); + lua_tcp_push_error (cbd, TRUE, "IO read error: connection terminated"); } lua_tcp_plan_handler_event (cbd, FALSE, TRUE);