Commit Graph

25 Commits

Author SHA1 Message Date
Glenn Strauss 68d8d4c532 [multiple] stat_cache singleton 2020-07-08 19:54:28 -04:00
Glenn Strauss ed62e354ff [core] use config_plugin_values_init() 2020-07-08 18:08:51 -04:00
Glenn Strauss 42942ec97c [core] use high precision stat timestamp on OS X 2019-05-13 21:01:57 -04:00
Glenn Strauss 338c73fd28 [core] use high precision stat timestamp in etag
use high precision stat timestamp (on systems where available) in etag
2019-05-04 13:48:22 -04:00
Glenn Strauss 0dccda28ad [core] add const to some etag prototypes 2019-04-20 02:10:28 -04:00
Glenn Strauss f69bd9cdb8 [core] perf: simple, quick buffer_clear()
quickly clear buffer instead of buffer_string_set_length(b, 0) or
buffer_reset(b).  Avoids free() of large buffers about to be reused,
or buffers that are module-scoped, persistent, and reused.

(buffer_reset() should still be used with buffers in connection *con
 when the data in the buffers is supplied by external, untrusted source)
2018-11-23 00:37:38 -05:00
Glenn Strauss 04d76e7afd [core] some header cleanup
provide standard types in first.h instead of base.h
provide lighttpd types in base_decls.h instead of settings.h
reduce headers exposed by headers for core data structures
  do not expose <pcre.h> or <stdlib.h> in headers
move stat_cache_entry to stat_cache.h
reduce use of "server.h" and "base.h" in headers
2018-04-08 22:22:23 -04:00
Glenn Strauss 9e75b81982 [core] reduce exposure of unistd.h, other includes
reduce exposure of unistd.h, and some other include cleanup
2017-07-15 22:42:15 -04:00
Glenn Strauss 8abd06a7ff consistent inclusion of config.h at top of files (fixes #2073)
From: Glenn Strauss <gstrauss@gluelogic.com>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3113 152afb58-edef-0310-8abb-c4023f1b3aa9
2016-03-19 15:14:35 +00:00
Stefan Bühler cfc88cf8f2 check pointer before usage in new etag compare
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2995 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-07-05 20:19:17 +00:00
Stefan Bühler 9f05b61ab4 parse If-None-Match for ETag validation (fixes #2578)
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2994 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-07-05 16:59:01 +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 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 63233d3c47 Fix etag formatting
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2730 152afb58-edef-0310-8abb-c4023f1b3aa9
2010-07-04 07:45:17 +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 c634a51de6 Fix hashing the terminating zero in etag.c
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2438 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-04-09 16:51:54 +00:00
Stefan Bühler 0a894c9cb3 r2094@chromobil: stefan | 2008-02-26 17:10:49 +0100
Fix #1413: including of stdint.h/inttypes.h in etag.c


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2089 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-02-26 16:21:20 +00:00
Marcus Rückert 15d8378422 - make sure the etag buffer is non empty if we compare it with if-non-match
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1971 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-08-27 21:54:45 +00:00
Jan Kneschke 41271d5cf6 make sure that hash-function always uses a 32bit int (fixes #1279)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1908 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-08-15 09:49:15 +00:00
Marcus Rückert 8feb331858 - we did not reset the etag buffer is the inode was not used for the
etag. we now reset the buffer explicitly and use buffer_append_* later
  on. This fixes the bug reported by glen in #1209.


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1880 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-07-03 17:16:21 +00:00
Jan Kneschke b2a96c959a added static-file.etags, etag.use-inode, etag.use-mtime,
etag.use-size to customize the generation of ETags for 
static files. (fixes #1209) (patch by <Yusufg@gmail.com>)



git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1874 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-06-15 15:51:16 +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 7bca57bb6b final fix for testcase and #177
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@378 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-06-12 09:18:17 +00:00
Jan Kneschke 5986add693 Quote ETag, fixes #117
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@376 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-06-12 09:09:28 +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