From 0226ca4366ca41253f5d5c1342f88e5c2c60da59 Mon Sep 17 00:00:00 2001 From: azw Date: Mon, 6 May 2024 09:24:32 +0800 Subject: [PATCH] 1 --- server/stat/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/stat/src/main.rs b/server/stat/src/main.rs index 739e8e2..b43ddc9 100755 --- a/server/stat/src/main.rs +++ b/server/stat/src/main.rs @@ -80,8 +80,8 @@ impl MyWs { tmp_bytes.put_u16_le(magic_code); tmp_bytes.put_u16_le(ext_len); tmp_bytes.put_i32_le(0); - tmp_bytes.put_u16_le(0); - tmp_bytes.put_u16_le(0); + //tmp_bytes.put_u16_le(0); + //tmp_bytes.put_u16_le(0); tmp_bytes.put_i64_le(0); /*tmp_bytes.put_u16(0); tmp_bytes.put_u16(0); @@ -110,6 +110,9 @@ impl MyWs { self.recv_buf[..0].copy_from_slice(&bin); } self.recv_buf_len -= offset; + if self.recv_buf_len > 0 { + self.recv_buf_len = 0; + } if already_read_bytes >= bin.len() { already_read_bytes = 0; break;