Commit Graph

47 Commits

Author SHA1 Message Date
Glenn Strauss 75e4859a1b [mod_compress] case-insensitive content-codings (fixes #2645)
From: Glenn Strauss <gstrauss@gluelogic.com>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3086 152afb58-edef-0310-8abb-c4023f1b3aa9
2016-02-28 11:59:09 +00:00
Stefan Bühler c512345fa2 [config] check config option scope; warn if server option is given in conditional
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3049 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-11-07 12:51:11 +00:00
Stefan Bühler 33cebeb0f7 fix segfaults in many plugins if they failed configuration
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2988 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-05-14 09:38:33 +00:00
Stefan Bühler ad3e93ea96 Use buffer API to read and modify "used" member
- a lot of code tried to handle manually adding terminating zeroes and
  keeping track of the correct "used" count.
  Replaced all "external" usages with simple wrapper functions:
  * buffer_string_is_empty (used <= 1), buffer_is_empty (used == 0);
    prefer buffer_string_is_empty
  * buffer_string_set_length
  * buffer_string_length
  * CONST_BUF_LEN() macro
- removed "static" buffer hacks (buffers pointing to constant/stack
  memory instead of malloc()ed data)
- buffer_append_strftime(): refactor buffer+strftime uses
- li_tohex(): no need for a buffer for binary-to-hex conversion:
  the output data length is easy to predict
- remove "-Winline" from extra warnings: the "inline" keyword just
  supresses the warning about unused but defined (static) functions;
  don't care whether it actually gets inlined or not.

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2979 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-02-08 19:10:44 +00:00
Stefan Bühler 4365bdbebe Remove buffer_prepare_copy() and buffer_prepare_append()
* removed almost all usages of buffer as "memory" (without terminating
  zero)
* refactored cgi variable name encoding

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2977 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-02-08 19:10:39 +00:00
Stefan Bühler 1be163b44a Remove chunkqueue_get_{append,prepend}* API
Although those were "easy" to use, they violated the abstraction:
  content of the chunkqueue should only be modified via the API.
  Replace with chunkqueue_get_memory() and chunkqueue_use_memory() for
  functions that read data from network (reusing large buffers),
  chunkqueue_steal_with_tempfiles() to store request bodies on disk
  temporarily.
  Modules that were generating content and need a buffer maintain the
  buffer manually (have to be careful to free the buffer on errors, as
  it isn't part of the chunkqueue yet).

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2976 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-02-08 19:10:36 +00:00
Stefan Bühler 6afad87d2e fix buffer, chunk and http_chunk API
* remove unused structs and functions
    (buffer_array, read_buffer)
  * change return type from int to void for many functions,
    as the return value (indicating error/success) was never checked,
    and the function would only fail on programming errors and not on
    invalid input; changed functions to use force_assert instead of
    returning an error.
  * all "len" parameters now are the real size of the memory to be read.
    the length of strings is given always without the terminating 0.
  * the "buffer" struct still counts the terminating 0 in ->used,
    provide buffer_string_length() to get the length of a string in a
    buffer.
    unset config "strings" have used == 0, which is used in some places
    to distinguish unset values from "" (empty string) values.
  * most buffer usages should now use it as string container.
  * optimise some buffer copying by "moving" data to other buffers
  * use (u)intmax_t for generic int-to-string functions
  * remove unused enum values: UNUSED_CHUNK, ENCODING_UNSET
  * converted BUFFER_APPEND_SLASH to inline function (no macro feature
    needed)
  * refactor: create chunkqueue_steal: moving (partial) chunks into another
    queue
  * http_chunk: added separate function to terminate chunked body instead of
    magic handling in http_chunk_append_mem().
    http_chunk_append_* now handle empty chunks, and never terminate the
    chunked body.

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2975 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-02-08 12:37:10 +00:00
Stefan Bühler 07dd0bd0a5 add force_assert() to enforce assertions as simple assert()s are disabled by -DNDEBUG (fixes #2546)
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2948 152afb58-edef-0310-8abb-c4023f1b3aa9
2014-02-16 13:08:20 +00:00
Stefan Bühler bcd35cc264 remove logical dead code
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2945 152afb58-edef-0310-8abb-c4023f1b3aa9
2014-02-14 21:06:14 +00:00
Stefan Bühler 6f208cfde1 fix/silence bugs reported by ccc-analyzer (clang)
These should all be non critical:
 * memory leaks on startup in error cases (which lead to
   immediate shutdowns anyway)
 * http_auth/ldap: passing uninitialized "ret" to ldap_err2string
 * sizeof(T) not matching the target pointer in malloc/calloc calls;
   those cases were either:
   * T being the wrong pointer type - shouldn't matter as long as all
     pointers have same size
   * T being larger than the type needed
 * mod_accesslog: direct use after free in cleanup (server shutdown);
   could crash before "clean" shutdown
 * some false positives (mod_compress, mod_expire)
 * assert(srv->config_context->used > 0); - this is always the case,
   as there is always a global config block

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2920 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-11-13 11:43:26 +00:00
Stefan Bühler 4002dce596 detect "x-gzip"/"x-bzip2" as separate encodings, more strict encoding matching (fixes #2443)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2856 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-11-09 14:23:24 +00:00
Cyril Brulebois 9c43331382 Use NULL instead of 0 where pointers are expected.
There are 6 remaining occurrences after this commit, in mod_compress,
due to zlib's Z_NULL being defined as 0 instead of NULL.

Signed-off-by: Cyril Brulebois <kibi@debian.org>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2845 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-08-31 14:11:43 +00:00
Stefan Bühler f4c3a99eea Disable mmap by default (fixes #2391)
* if a user truncates a file we are mmapping, reading the truncated
  area leads to SIGBUS
* mod_cgi and mod_webdav still use mmap for reading the tmp files
  created for large request bodies.
  as no other user should have write access for those this isn't
  a (security) problem.

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2827 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-02-24 18:34:20 +00:00
Stefan Bühler 33f1ec6d28 [mod_compress] fix handling if etags are disabled but cache-dir is set - may lead to double response
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2826 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-01-11 21:59:51 +00:00
Stefan Bühler 494ce8e3b0 [mod_compress] Fix segfault when etags are disabled (fixes #2169)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2723 152afb58-edef-0310-8abb-c4023f1b3aa9
2010-04-28 13:35:25 +00:00
Stefan Bühler d21c645bfa mod_compress: match partial+full content-type (fixes #1552)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2634 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-10-11 19:27:55 +00:00
Stefan Bühler 22e8b456a9 Fix header inclusion order, always include "config.h" before any system header
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2624 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-10-11 14:31:42 +00:00
Stefan Bühler 63f785a2f8 Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2414 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-03-07 21:05:37 +00:00
Stefan Bühler f0bbc7468c Use modified etags in mod_compress (fixes #1800)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2386 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-02-04 17:30:18 +00:00
Stefan Bühler fdcb6f60f4 Allow mod_compress to return 304 (Not Modified); compress ignores the static-file.etags option.(fixes #1884)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2384 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-02-04 10:27:42 +00:00
Elan Ruusamäe c6c2bf8308 - Add possibility to disable methods in mod_compress (#1773)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2325 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-10-03 10:05:33 +00:00
Stefan Bühler 52861d77df Replace buffer_{append,copy}_string with the _len variant where possible (#1732, thx crypt)
Replace BUFFER_{APPEND,COPY}_STRING_CONST with _len(b, CONST_STRL_LEN(x))


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2250 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-07-30 19:38:32 +00:00
Stefan Bühler fcce4c9cbb Fix comment style (use /* */ instead of //)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2151 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-04-23 13:10:41 +00:00
Stefan Bühler adec5443ee Fix mod_compress to compile with old gcc version (#1592)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2128 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-03-13 15:34:10 +00:00
Stefan Bühler 87d3e8e41e Fix #1150: remove compress cache file if compression or write failed
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2101 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-02-27 19:36:34 +00:00
Stefan Bühler a103fef58c r2090@chromobil: stefan | 2008-02-26 17:04:14 +0100
Fix #1171: Generate a etag/last-modified header for on-the-fly-compressed files. (as 1.5 already does)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2085 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-02-26 16:20:37 +00:00
Stefan Bühler 75f92dd796 r2088@chromobil: stefan | 2008-02-26 17:02:27 +0100
Fix #1565: mod_compress should check if the request is already handled, e.g. by fastcgi


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2083 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-02-26 16:20:15 +00:00
Stefan Bühler d0862e8522 r2086@chromobil: stefan | 2008-02-26 16:15:28 +0100
Fix #1027: create directories in mod_compress (was broken with alias/userdir)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2081 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-02-26 16:19:53 +00:00
Jan Kneschke e8abdbf94e don't compress too small files (fixes #1241)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1918 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-08-15 12:12:13 +00:00
Marcus Rückert 8cd1471cb3 - white space cleanup part 2 this time 1.4 ;)
i hope it helps with merging stuff back to 1.5

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1371 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-10-04 13:26:23 +00:00
Jan Kneschke a4be52451f more unsigned/sign compare fixes
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@861 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-11-18 12:00:48 +00:00
Jan Kneschke ff29203dba close fds on error and add CLOEXEC to FDs which stay open for a longer time
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@794 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-10-22 08:10:07 +00:00
Jan Kneschke 51d6e2abf0 fixed output of non-cached compressed content and added test-cases
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@779 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-10-04 09:25:29 +00:00
Jan Kneschke b4d9d061c8 either remove include config.h or covered it in HAVE_CONFIG_H
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@733 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-09-24 12:06:04 +00:00
Jan Kneschke e93ac5407b if the write is waiting, break the loop.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@621 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-25 06:21:32 +00:00
Jan Kneschke e8c45fbd58 don't try to compress a empty filename
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@602 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-21 23:09:15 +00:00
Jan Kneschke 172340e22f let mod_compress prepare etag, last-modified and content-type
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@569 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-18 09:26:29 +00:00
Jan Kneschke 718e97b68b don't segfault on stat-failed
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@552 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-16 14:22:03 +00:00
Jan Kneschke ae02f2c48b mod_staticfile is the next plugin, so don't call HANDLER_FINISHED
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@549 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-15 18:04:58 +00:00
Jan Kneschke f926c361f9 ..physical_path is gone and has ben replaced by subrequest_start
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@532 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-15 09:46:23 +00:00
Jan Kneschke c8408d015c removed setup_connection (merged [295])
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@512 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 10:27:07 +00:00
Jan Kneschke c25cf5a056 O_BINARY for cygwin, volatile for sig_atomic_t (merged [286], [287])
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@505 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 09:48:38 +00:00
Jan Kneschke 5e134da075 dropped file-cache, added stat-cache and modules ALWAYS cleanup at connection-end
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@502 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 08:22:06 +00:00
Jan Kneschke 8e67134b23 use size_t instead of unsigned int and char * instead of unsigned char *
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@369 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-06-05 11:59:33 +00:00
Jan Kneschke 06c35abe4a updated ChangeLog and NEWS from timeline
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@70 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-03-01 23:28:52 +00:00
Jan Kneschke bde657648d compile fixes for MIPSpro on IRIX
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@68 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-03-01 23:01:12 +00:00
Jan Kneschke bcdc6a3bbc moved everything below trunk/ and added branches/ and tags/
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@30 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-02-20 14:27:00 +00:00