mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-28 20:58:31 +00:00
More checks in mg_ws_send
This commit is contained in:
1 parent
2f9d2bbdf6
commit
1b0636c2d2
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -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));
|
LOG(LL_VERBOSE_DEBUG, ("WS out: %d [%.*s]", (int) len, (int) len, buf));
|
||||||
mg_send(c, buf, len);
|
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;
|
uint8_t *p = c->send.buf + c->send.len - len;
|
||||||
for (i = 0; i < len; i++) p[i] ^= mask[i & 3];
|
for (i = 0; i < len; i++) p[i] ^= mask[i & 3];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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));
|
LOG(LL_VERBOSE_DEBUG, ("WS out: %d [%.*s]", (int) len, (int) len, buf));
|
||||||
mg_send(c, buf, len);
|
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;
|
uint8_t *p = c->send.buf + c->send.len - len;
|
||||||
for (i = 0; i < len; i++) p[i] ^= mask[i & 3];
|
for (i = 0; i < len; i++) p[i] ^= mask[i & 3];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user