mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-19 11:09:42 +00:00
Add align to struct mg_iobuf
This commit is contained in:
1 parent
a468f58128
commit
17e2fdd4cb
12 files changed
+92
-74
No files matched your search
@@ -290,7 +290,7 @@ size_t mg_ws_wrap(struct mg_connection *c, size_t len, int op) {
|
||||
size_t header_len = mkhdr(len, op, c->is_client, header);
|
||||
|
||||
// NOTE: order of operations is important!
|
||||
mg_iobuf_add(&c->send, c->send.len, NULL, header_len, MG_IO_SIZE);
|
||||
mg_iobuf_add(&c->send, c->send.len, NULL, header_len);
|
||||
p = &c->send.buf[c->send.len - len]; // p points to data
|
||||
memmove(p, p - header_len, len); // Shift data
|
||||
memcpy(p - header_len, header, header_len); // Prepend header
|
||||
|
||||
Reference in new issue
Block a user