mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-27 04:48:21 +01:00
debug code removed.
This commit is contained in:
parent
6fd40adc77
commit
ce0ad4c6b6
@ -29,7 +29,6 @@ end
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
local try_send = function(sock, line)
|
local try_send = function(sock, line)
|
||||||
local err = sock:send(line .. "\r\n")
|
local err = sock:send(line .. "\r\n")
|
||||||
print(line)
|
|
||||||
if err then sock:close() end
|
if err then sock:close() end
|
||||||
return err
|
return err
|
||||||
end
|
end
|
||||||
@ -47,14 +46,12 @@ local get_answer = function(control)
|
|||||||
local line, err = control:receive()
|
local line, err = control:receive()
|
||||||
local answer = line
|
local answer = line
|
||||||
if err then return nil, err end
|
if err then return nil, err end
|
||||||
print(line)
|
|
||||||
_,_, code, sep = strfind(line, "^(%d%d%d)(.)")
|
_,_, code, sep = strfind(line, "^(%d%d%d)(.)")
|
||||||
if not code or not sep then return nil, answer end
|
if not code or not sep then return nil, answer end
|
||||||
if sep == "-" then -- answer is multiline
|
if sep == "-" then -- answer is multiline
|
||||||
repeat
|
repeat
|
||||||
line, err = control:receive()
|
line, err = control:receive()
|
||||||
if err then return nil, err end
|
if err then return nil, err end
|
||||||
print(line)
|
|
||||||
_,_, lastcode, sep = strfind(line, "^(%d%d%d)(.)")
|
_,_, lastcode, sep = strfind(line, "^(%d%d%d)(.)")
|
||||||
answer = answer .. "\n" .. line
|
answer = answer .. "\n" .. line
|
||||||
until code == lastcode and sep == " " -- answer ends with same code
|
until code == lastcode and sep == " " -- answer ends with same code
|
||||||
|
Loading…
Reference in New Issue
Block a user