Project

General

Profile

[Solved] A patch to introduce new option `server.max-chunkfile-size'.

Added by mod.cfp almost 14 years ago

Hello lighttpd developers,

I'm developing a small plugin module based on lighttpd 1.4.26; it's called mod_cfp (http://code.google.com/p/mod-cfp/). During developing this module I encountered a problem to process POST method, specially uploading a large file over 2MB.

The problem was that in the lighttpd it splited the whole file into maximum 1 MB temporary files. For example if the content length was 5 MB it created 5 temporary files.

It looks it's reasonable for supporting CGI-like interfaces because it's an easy to send contents through pipe(2). However mod_cfp is a glue plugin so it doesn't use pipe(2) or sockets. Only ways were using read(2) or mmap(2). These interfaces for seperated files are really inefficient for me.

Moreover the parsing of POST method (e.g. RFC1867) is a big problem because it's very hard to recognize where the query key name is. For example, if the key name is `ABCDEFGHIJKL' it could be placed as follows:

  • CHUNK1: [blah......]ABCDEF
  • CHUNK2: GHIJKL[blah....]

It's very hard for me to know start and end of the key name because it's laid on two chunk temporary files. In this environemnt I felt that it'd be better to add a new option for lighttpd to remove a constant (1 * 1024 * 1024) in lighttpd code.

Could you guys please review my patch?

patch_lighttpd_20100621.diff (2.68 KB) patch_lighttpd_20100621.diff a patch for `server.max-chunkfile-size' option.

Replies (1)

RE: A patch to introduce new option `server.max-chunkfile-size'. - Added by gstrauss over 3 years ago

server.upload-temp-file-size was added in lighttpd 1.4.38. See #2680

    (1-1/1)