From 52f9f91d91aa33a1483334f69073f3e6250cd168 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Mon, 10 Aug 2026 15:27:12 +0200 Subject: refactor(receive): make implicit line reads explicit --- src/tp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tp.lua') diff --git a/src/tp.lua b/src/tp.lua index b8ebc56..bf4bc14 100644 --- a/src/tp.lua +++ b/src/tp.lua @@ -26,14 +26,14 @@ _M.TIMEOUT = 60 -- gets server reply (works for SMTP and FTP) local function get_reply(c) local code, current, sep - local line, err = c:receive() + local line, err = c:receive("*l") local reply = line if err then return nil, err end code, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)")) if not code then return nil, "invalid server reply" end if sep == "-" then -- reply is multiline repeat - line, err = c:receive() + line, err = c:receive("*l") if err then return nil, err end current, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)")) reply = reply .. "\n" .. line -- cgit v1.2.3-55-g6feb