修复一个错误
This commit is contained in:
@@ -77,16 +77,16 @@ do--Connect
|
|||||||
code=l:find(" "); code=l:sub(code+1,code+3)
|
code=l:find(" "); code=l:sub(code+1,code+3)
|
||||||
end
|
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
|
if code=="101"then
|
||||||
readCHN:push("success")
|
readCHN:push("success")
|
||||||
else
|
else
|
||||||
local ctLen
|
|
||||||
repeat
|
|
||||||
l=SOCK:receive("*l")
|
|
||||||
if not ctLen and l:find"Length"then
|
|
||||||
ctLen=tonumber(l:match"%d+")
|
|
||||||
end
|
|
||||||
until l==""
|
|
||||||
local reason=JSON.decode(SOCK:receive(ctLen))
|
local reason=JSON.decode(SOCK:receive(ctLen))
|
||||||
readCHN:push(code..":"..(reason and reason.message or"Server Error"))
|
readCHN:push(code..":"..(reason and reason.message or"Server Error"))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user