aboutsummaryrefslogtreecommitdiff
path: root/src/tp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/tp.lua')
-rw-r--r--src/tp.lua4
1 files changed, 2 insertions, 2 deletions
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
26-- gets server reply (works for SMTP and FTP) 26-- gets server reply (works for SMTP and FTP)
27local function get_reply(c) 27local function get_reply(c)
28 local code, current, sep 28 local code, current, sep
29 local line, err = c:receive() 29 local line, err = c:receive("*l")
30 local reply = line 30 local reply = line
31 if err then return nil, err end 31 if err then return nil, err end
32 code, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)")) 32 code, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)"))
33 if not code then return nil, "invalid server reply" end 33 if not code then return nil, "invalid server reply" end
34 if sep == "-" then -- reply is multiline 34 if sep == "-" then -- reply is multiline
35 repeat 35 repeat
36 line, err = c:receive() 36 line, err = c:receive("*l")
37 if err then return nil, err end 37 if err then return nil, err end
38 current, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)")) 38 current, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)"))
39 reply = reply .. "\n" .. line 39 reply = reply .. "\n" .. line