mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-23 11:44:53 +00:00
Improve ff_write - save large blocks in chunks
This commit is contained in:
1 parent
1259ca9ac9
commit
4cd830a0bf
6 files changed
+38
-20
No files matched your search
+2
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user