Fix #1488 - properly set non-blocking flags on accepted connections

This commit is contained in:
Sergey Lyubka committed 2022-03-14 13:26:00 +00:00
1 parent 02cabcc0ec
commit 37cb51ee94
5 files changed
+25 -25

No files matched your search

+2 -2
View File
@@ -60,8 +60,8 @@ size_t mg_iobuf_add(struct mg_iobuf *io, size_t ofs, const void *buf,
size_t mg_iobuf_del(struct mg_iobuf *io, size_t ofs, size_t len) {
if (ofs > io->len) ofs = io->len;
if (ofs + len > io->len) len = io->len - ofs;
memmove(io->buf + ofs, io->buf + ofs + len, io->len - ofs - len);
zeromem(io->buf + io->len - len, len);
if (io->buf) memmove(io->buf + ofs, io->buf + ofs + len, io->len - ofs - len);
if (io->buf) zeromem(io->buf + io->len - len, len);
io->len -= len;
return len;
}