From 29af52c72e7eafcc9b7e50693e9c2e9fc6b59c0a Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 27 Mar 2021 22:04:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9E=E6=8E=A5=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E4=BC=9A=E7=88=86=E7=82=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/websocket.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Zframework/websocket.lua b/Zframework/websocket.lua index 4273fdf5..ec4aec37 100644 --- a/Zframework/websocket.lua +++ b/Zframework/websocket.lua @@ -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