mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +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
@@ -2004,6 +2004,7 @@ bool mg_send(struct mg_connection *c, const void *buf, size_t len) {
|
||||
res = tx_udp(ifp, s->mac, &c->loc, &c->rem, buf, len);
|
||||
} else {
|
||||
res = mg_iobuf_add(&c->send, c->send.len, buf, len);
|
||||
// res == 0 means an OOM condition (iobuf couldn't resize), yet this is so far recoverable, let the caller decide
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user