mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-19 08:03:14 +08:00
More checks in mg_ws_send
This commit is contained in:
parent
2f9d2bbdf6
commit
1b0636c2d2
@ -3941,7 +3941,7 @@ size_t mg_ws_send(struct mg_connection *c, const char *buf, size_t len,
|
||||
}
|
||||
LOG(LL_VERBOSE_DEBUG, ("WS out: %d [%.*s]", (int) len, (int) len, buf));
|
||||
mg_send(c, buf, len);
|
||||
if (c->is_client) {
|
||||
if (c->is_client && c->send.buf != NULL) {
|
||||
uint8_t *p = c->send.buf + c->send.len - len;
|
||||
for (i = 0; i < len; i++) p[i] ^= mask[i & 3];
|
||||
}
|
||||
|
2
src/ws.c
2
src/ws.c
@ -95,7 +95,7 @@ size_t mg_ws_send(struct mg_connection *c, const char *buf, size_t len,
|
||||
}
|
||||
LOG(LL_VERBOSE_DEBUG, ("WS out: %d [%.*s]", (int) len, (int) len, buf));
|
||||
mg_send(c, buf, len);
|
||||
if (c->is_client) {
|
||||
if (c->is_client && c->send.buf != NULL) {
|
||||
uint8_t *p = c->send.buf + c->send.len - len;
|
||||
for (i = 0; i < len; i++) p[i] ^= mask[i & 3];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user