diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2019-09-08 02:15:15 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2019-09-08 02:15:15 -0400 |
commit | 019efb0ed8ebaee8d23301d921e2c79ff293bab2 (patch) | |
tree | 8bd7733c6e868d69c16f6fe82c03c1def5178c2f | |
parent | 339064228589f8f76c905abd2de3e5f744539c86 (diff) | |
download | lighttpd1.4-019efb0ed8ebaee8d23301d921e2c79ff293bab2.tar.gz lighttpd1.4-019efb0ed8ebaee8d23301d921e2c79ff293bab2.zip |
[mod_webdav] fix file uploads > 128M (fixes #2970)
(thx Gundersanne)
x-ref:
"mod_webdav writes to fd=-1 when uploading large files (1000M)"
https://redmine.lighttpd.net/issues/2970
-rw-r--r-- | src/mod_webdav.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mod_webdav.c b/src/mod_webdav.c index 16f74170..1f690722 100644 --- a/src/mod_webdav.c +++ b/src/mod_webdav.c @@ -3325,7 +3325,7 @@ webdav_mmap_file_chunk (chunk * const c) /*(request body provided in temporary file, so ok to mmap(). * Otherwise, must check defined(ENABLE_MMAP)) */ /* chunk_reset() or chunk_free() will clean up mmap'd chunk */ - /* close c->file.fd only faster mmap() succeeds, since it will not + /* close c->file.fd only after mmap() succeeds, since it will not * be able to be re-opened if it was a tmpfile that was unlinked */ /*assert(c->type == FILE_CHUNK);*/ if (MAP_FAILED != c->file.mmap.start) @@ -4274,6 +4274,9 @@ mod_webdav_put_prep (connection * const con, const plugin_config * const pconf) } buffer_clear(cq->last->mem); /* file already unlink()ed */ chunkqueue_set_tempdirs(cq, cq->tempdirs, INTMAX_MAX); + /* force huge cq->upload_temp_file_size since chunkqueue_set_tempdirs() + * might truncate upload_temp_file_size to chunk.c:MAX_TEMPFILE_SIZE */ + cq->upload_temp_file_size = INTMAX_MAX; cq->last->file.is_temp = 1; return HANDLER_GO_ON; |