mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-07 16:01:30 +00:00
Handle OOM situations in iobuf expansion
This commit is contained in:
1 parent
b53d8439e5
commit
b8994f8bc3
9 files changed
+264
-224
No files matched your search
@@ -292,6 +292,6 @@ size_t mg_ws_wrap(struct mg_connection *c, size_t len, int op) {
|
||||
memmove(p, p - header_len, len); // Shift data
|
||||
memcpy(p - header_len, header, header_len); // Prepend header
|
||||
mg_ws_mask(c, len); // Mask data
|
||||
}
|
||||
return c->send.len;
|
||||
} // returning 0 means an OOM condition (iobuf couldn't resize), yet this is
|
||||
return c->send.len; // so far recoverable, let the caller decide
|
||||
}
|
||||
Reference in new issue
Block a user