Skip to content

Commit

Permalink
临时提交修改
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed Oct 26, 2023
1 parent 3c50f66 commit ca3623a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extend/lcodec/src/websocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ namespace lcodec {
body = (uint8_t*)lua_tolstring(L, index + 1, len);
}
m_buf->write<uint8_t>((0x80 | opcode));
if (*len < 126) {
if (*len < 0x7e) {
m_buf->write<uint8_t>(*len);
} else if (*len < 0xffff) {
m_buf->write<uint8_t>(126);
} else if (*len <= 0xffff) {
m_buf->write<uint8_t>(0x7e);
m_buf->write<uint16_t>(byteswap2(*len));
} else {
m_buf->write<uint8_t>(127);
m_buf->write<uint8_t>(0x7f);
m_buf->write<uint64_t>(byteswap8(*len));
}
m_buf->push_data(body, *len);
Expand Down

0 comments on commit ca3623a

Please sign in to comment.