This commit is contained in:
azw 2024-05-06 09:24:32 +08:00
parent 6131ac93a9
commit 0226ca4366

View File

@ -80,8 +80,8 @@ impl MyWs {
tmp_bytes.put_u16_le(magic_code); tmp_bytes.put_u16_le(magic_code);
tmp_bytes.put_u16_le(ext_len); tmp_bytes.put_u16_le(ext_len);
tmp_bytes.put_i32_le(0); 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_i64_le(0);
/*tmp_bytes.put_u16(0); /*tmp_bytes.put_u16(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[..0].copy_from_slice(&bin);
} }
self.recv_buf_len -= offset; self.recv_buf_len -= offset;
if self.recv_buf_len > 0 {
self.recv_buf_len = 0;
}
if already_read_bytes >= bin.len() { if already_read_bytes >= bin.len() {
already_read_bytes = 0; already_read_bytes = 0;
break; break;