Ship the WeChat hot-update catalogs and the camp, TideWhale T2, UI atlas, and animation-lab work.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -240,6 +240,15 @@ void ws_loop(socket_t s) {
|
||||
buf.erase(buf.begin(), buf.begin() + static_cast<std::ptrdiff_t>(header + mask_len + payload_len));
|
||||
|
||||
if (opcode == 0x8) { // close
|
||||
// Complete the peer's close handshake before closing the TCP socket.
|
||||
std::vector<uint8_t> close_frame{0x88};
|
||||
if (payload.size() <= 125 && payload.size() != 1) {
|
||||
close_frame.push_back(static_cast<uint8_t>(payload.size()));
|
||||
close_frame.insert(close_frame.end(), payload.begin(), payload.end());
|
||||
} else {
|
||||
close_frame.insert(close_frame.end(), {2, 0x03, 0xEA}); // 1002 protocol error
|
||||
}
|
||||
send_all(s, reinterpret_cast<const char*>(close_frame.data()), close_frame.size());
|
||||
return;
|
||||
}
|
||||
if (opcode == 0x9) { // ping -> pong
|
||||
|
||||
Reference in New Issue
Block a user