increase upload temporary chunk file size from 1MB to 16MB

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3010 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.37
Stefan Bühler 7 years ago
parent 1371c87c34
commit 5c5616e3e5
  1. 1
      NEWS
  2. 9
      src/chunk.c

@ -7,6 +7,7 @@ NEWS
* [mod_proxy] remove debug log line from error log (fixes #2659)
* [mod_dirlisting] fix dir-listing.set-footer not showing
* fix out-of-filedescriptors when uploading "large" files (fixes #2660, thx rmilecki)
* increase upload temporary chunk file size from 1MB to 16MB
- 1.4.36 - 2015-07-26
* use keep-alive timeout while waiting for HTTP headers; use always the read timeout while waiting for the HTTP body

@ -417,15 +417,16 @@ static chunk *chunkqueue_get_append_tempfile(chunkqueue *cq) {
}
static int chunkqueue_append_to_tempfile(server *srv, chunkqueue *dest, const char *mem, size_t len) {
/* copy everything to max MAX_TEMPFILE_SIZE sized tempfiles */
static const off_t MAX_TEMPFILE_SIZE = 16 * 1024 * 1024; /* 16MB */
chunk *dst_c = NULL;
ssize_t written;
/* copy everything to max 1Mb sized tempfiles */
/*
* if the last chunk is
* - smaller than 1Mb (size < 1Mb)
* - smaller than MAX_TEMPFILE_SIZE
* - not read yet (offset == 0)
* -> append to it
* -> append to it (so it might actually become larger than MAX_TEMPFILE_SIZE)
* otherwise
* -> create a new chunk
*
@ -439,7 +440,7 @@ static int chunkqueue_append_to_tempfile(server *srv, chunkqueue *dest, const ch
/* ok, take the last chunk for our job */
dst_c = dest->last;
if (dest->last->file.length >= 1 * 1024 * 1024) {
if (dest->last->file.length >= MAX_TEMPFILE_SIZE) {
/* the chunk is too large now, close it */
if (-1 != dst_c->file.fd) {
close(dst_c->file.fd);

Loading…
Cancel
Save