修复连接成功会爆炸

This commit is contained in:
MrZ626
2021-03-27 22:04:56 +08:00
parent a3ff9dacc8
commit 29af52c72e

View File

@@ -72,18 +72,16 @@ do--Connect
--First line of HTTP
local l=SOCK:receive("*l")
local code
local code,ctLen
if l then
code=l:find(" "); code=l:sub(code+1,code+3)
repeat
l=SOCK:receive("*l")
if not ctLen and l:find"Length"then
ctLen=tonumber(l:match"%d+")
end
until l==""
end
local ctLen
repeat
l=SOCK:receive("*l")
if not ctLen and l:find"Length"then
ctLen=tonumber(l:match"%d+")
end
until l==""
if code=="101"then
readCHN:push("success")
else