Improve ff_write - save large blocks in chunks

This commit is contained in:
Sergey Lyubka committed 2022-01-19 08:43:34 +00:00
1 parent 1259ca9ac9
commit 4cd830a0bf
6 files changed
+38 -20

No files matched your search

+2 -2
View File
@@ -906,9 +906,9 @@ int mg_http_upload(struct mg_connection *c, struct mg_http_message *hm,
mg_http_reply(c, 400, "", "open(%s): %d", path, errno);
return -2;
} else {
fs->write(fd->fd, hm->body.ptr, hm->body.len);
int written = (int) fs->write(fd->fd, hm->body.ptr, hm->body.len);
mg_fs_close(fd);
mg_http_reply(c, 200, "", "");
mg_http_reply(c, 200, "", "%d", written);
return (int) hm->body.len;
}
}