diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-22 14:17:33 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-22 14:17:33 +0000 |
commit | c249c21fc159451eff0c088ebec00d00dbd3ebaa (patch) | |
tree | 90a0aaf9feb11b0560c8291c34421f3cabf7c8f0 | |
parent | 75e7de90cd1fec5b3fbf60e8e341f14ddc86b725 (diff) | |
download | rspamd-c249c21fc159451eff0c088ebec00d00dbd3ebaa.tar.gz rspamd-c249c21fc159451eff0c088ebec00d00dbd3ebaa.zip |
[Fix] Emit error if connection has been terminated with no stop pattern
-rw-r--r-- | src/lua/lua_tcp.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index b9406111a..047bfe444 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); |