Merge branch 'ci-web-revive'

This commit is contained in:
MrZ_26
2024-08-07 12:11:32 +08:00
parent f1a08ca325
commit 24d552ba2b
3 changed files with 15 additions and 11 deletions

View File

@@ -40,21 +40,25 @@ do-- Connect
repeat
res,err=SOCK:receive('*l')
assert(res,err)
if not ctLen and res:find('length') then
ctLen=tonumber(res:match('%d+'))
if not ctLen and res:find('content-length') then
ctLen=tonumber(res:match('%d+')) or 0
end
until res==''
-- Result
if code=='101' then
CHN_push(readCHN,'success')
end
-- Content(?)
if ctLen then
if code=='101' then
CHN_push(readCHN,'success')
else
res,err=SOCK:receive(ctLen)
res,err=SOCK:receive(ctLen)
if code~='101' then
res=JSON.decode(assert(res,err))
error((code or "XXX")..":"..(res and res.reason or "Server Error"))
end
end
SOCK:settimeout(0)
end