History log of /lighttpd1.4/src/stat_cache.c (Results 1 – 25 of 151)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: lighttpd-1.4.69
# f0786a75 22-Jan-2023 Glenn Strauss <[email protected]>

[core] pass fdn to fdevent_sched_close,_unregister

remove issock flag; on _WIN32, select(), WSAPoll() work only on sockets


# 6516c5a2 19-Jan-2023 Glenn Strauss <[email protected]>

[multiple] clang -Wstrict-prototypes for C2x

adjustments to compile warnings-free with recent clang changes that
warn about potential behavior change for non-prototypes, including
generic function p

[multiple] clang -Wstrict-prototypes for C2x

adjustments to compile warnings-free with recent clang changes that
warn about potential behavior change for non-prototypes, including
generic function pointers e.g. int(*)()

x-ref:
https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2841.htm

show more ...


Revision tags: lighttpd-1.4.68
# 5e14db43 10-Dec-2022 Glenn Strauss <[email protected]>

[multiple] employ ck_calloc, ck_malloc shared code

employ ck_calloc(), ck_malloc() shared code to slightly reduce code size
(centralize the ck_assert() to check that memory allocation succeeded)


# fc38f2aa 28-Sep-2022 Glenn Strauss <[email protected]>

[core] use inotify_init() if missing IN_* defines

use inotify_init() if missing IN_CLOEXEC or IN_NONBLOCK
for inotify_init1(), but <sys/inotify.h> exists
(ancient Linux kernel and/or ancient glibc)


Revision tags: lighttpd-1.4.67, lighttpd-1.4.66, lighttpd-1.4.65
# 54c07b54 12-Mar-2022 Glenn Strauss <[email protected]>

[core] compiler workarounds for very old gcc,glibc

added in gcc 4.6:
#pragma GCC diagnostic push
#pragma GCC diagnostic pop
added in gcc 5 (?):
fix for error: #pragma GCC diagnostic not allowe

[core] compiler workarounds for very old gcc,glibc

added in gcc 4.6:
#pragma GCC diagnostic push
#pragma GCC diagnostic pop
added in gcc 5 (?):
fix for error: #pragma GCC diagnostic not allowed inside functions

x-ref:
https://redmine.lighttpd.net/boards/2/topics/10325

show more ...


Revision tags: lighttpd-1.4.64
# df070173 12-Dec-2021 Glenn Strauss <[email protected]>

[core] add more const to stat_cache_update_entry()


Revision tags: lighttpd-1.4.63, lighttpd-1.4.62, lighttpd-1.4.61, lighttpd-1.4.60
# b38817b6 17-Sep-2021 Glenn Strauss <[email protected]>

[core] mark attr malloc, returns nonnull

mark some core code with attributes malloc, returns nonnull


# cd738d4d 27-Aug-2021 Glenn Strauss <[email protected]>

[build] propagate HAVE_DLFCN_H in builds


# 9a2404ce 13-Jul-2021 Glenn Strauss <[email protected]>

[core] quiet compiler warnings

cast away signedness warning in request_check_hostname()
mod_gnutls https_add_ssl_client_entries crts allocated if crt_size != 0
(which is already checked earlier in

[core] quiet compiler warnings

cast away signedness warning in request_check_hostname()
mod_gnutls https_add_ssl_client_entries crts allocated if crt_size != 0
(which is already checked earlier in routine)

report from FaceBook Infer static analysis tool (https://fbinfer.com/)
- quiet dead store warnings
- check return != NULL from allocation funcs

show more ...


# 309c1693 12-Jul-2021 Glenn Strauss <[email protected]>

[multiple] Y2038 32-bit signed time_t mitigations

Most OS platforms have already provided solutions to
Y2038 32-bit signed time_t 5 - 10 years ago (or more!)
Notable exceptions are Linux i686 and Fr

[multiple] Y2038 32-bit signed time_t mitigations

Most OS platforms have already provided solutions to
Y2038 32-bit signed time_t 5 - 10 years ago (or more!)
Notable exceptions are Linux i686 and FreeBSD i386.

Since 32-bit systems tend to be embedded systems,
and since many distros take years to pick up new software,
this commit aims to provide Y2038 mitigations for lighttpd
running on 32-bit systems with Y2038-unsafe 32-bit signed time_t

* Y2038: lighttpd 1.4.60 and later report Y2038 safety
$ lighttpd -V
+ Y2038 support # Y2038-SAFE
$ lighttpd -V
- Y2038 support (unsafe 32-bit signed time_t) # Y2038-UNSAFE

* Y2038: general platform info
* Y2038-SAFE: lighttpd 64-bit builds on platforms using 64-bit time_t
- all major 64-bit platforms (known to this author) use 64-bit time_t
* Y2038-SAFE: lighttpd 32-bit builds on platforms using 64-bit time_t
- Linux x32 ABI (different from i686)
- FreeBSD all 32-bit and 64-bit architectures *except* 32-bit i386
- NetBSD 6.0 (released Oct 2012) all 32-bit and 64-bit architectures
- OpenBSD 5.5 (released May 2014) all 32-bit and 64-bit architectures
- Microsoft Windows XP and Visual Studio 2005 (? unsure ?)
Another reference suggests Visual Studio 2015 defaults to 64-bit time_t
- MacOS 10.15 Catalina (released 2019) drops support for 32-bit apps
* Y2038-SAFE: lighttpd 32-bit builds on platforms using 32-bit unsigned time_t
- e.g. OpenVMS (unknown if lighttpd builds on this platform)
* Y2038-UNSAFE: lighttpd 32-bit builds on platforms using 32-bit signed time_t
- Linux 32-bit (including i686)
- glibc 32-bit library support not yet available for 64-bit time_t
- https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
- Linux kernel 5.6 on 32-bit platforms does support 64-bit time_t
https://itsubuntu.com/linux-kernel-5-6-to-fix-the-year-2038-issue-unix-y2k/
- https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html
"Note: at this point, 64-bit time support in dual-time
configurations is work-in-progress, so for these
configurations, the public API only makes the 32-bit time
support available. In a later change, the public API will
allow user code to choose the time size for a given
compilation unit."
- compiling with -D_TIME_BITS=64 currently has no effect
- glibc recent (Jul 2021) mailing list discussion
- https://public-inbox.org/bug-gnulib/[email protected]/T/
- FreeBSD i386
- DragonFlyBSD 32-bit

* Y2038 mitigations attempted on Y2038-UNSAFE platforms (32-bit signed time_t)
* lighttpd prefers system monotonic clock instead of realtime clock
in places where realtime clock is not required
* lighttpd treats negative time_t values as after 19 Jan 2038 03:14:07 GMT
* (lighttpd presumes that lighttpd will not encounter dates before 1970
during normal operation.)
* lighttpd casts struct stat st.st_mtime (and st.st_*time) through uint64_t
to convert negative timestamps for comparisions with 64-bit timestamps
(treating negative timestamp values as after 19 Jan 2038 03:14:07 GMT)
* lighttpd provides unix_time64_t (int64_t) and
* lighttpd provides struct unix_timespec64 (unix_timespec64_t)
(struct timespec equivalent using unix_time64_t tv_sec member)
* lighttpd provides gmtime64_r() and localtime64_r() wrappers
for platforms 32-bit platforms using 32-bit time_t and
lighttpd temporarily shifts the year in order to use
gmtime_r() and localtime_r() (or gmtime() and localtime())
from standard libraries, before readjusting year and passing
struct tm to formatting functions such as strftime()
* lighttpd provides TIME64_CAST() macro to cast signed 32-bit time_t to
unsigned 32-bit and then to unix_time64_t

* Note: while lighttpd tries handle times past 19 Jan 2038 03:14:07 GMT
on 32-bit platforms using 32-bit signed time_t, underlying libraries and
underlying filesystems might not behave properly after 32-bit signed time_t
overflows (19 Jan 2038 03:14:08 GMT). If a given 32-bit OS does not work
properly using negative time_t values, then lighttpd likely will not work
properly on that system.

* Other references and blogs
- https://en.wikipedia.org/wiki/Year_2038_problem
- https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs
- http://www.lieberbiber.de/2017/03/14/a-look-at-the-year-20362038-problems-and-time-proofness-in-various-systems/

show more ...


# d22e94ac 09-Jun-2021 Glenn Strauss <[email protected]>

[core] clear etag in stat_cache_get_entry_open()

clear etag in stat_cache_get_entry_open() after opening file
(in case a different caller used stat_get_get_entry() and then file
changed before being

[core] clear etag in stat_cache_get_entry_open()

clear etag in stat_cache_get_entry_open() after opening file
(in case a different caller used stat_get_get_entry() and then file
changed before being opened)

show more ...


# af3df29a 09-Jun-2021 Glenn Strauss <[email protected]>

[multiple] reduce redundant NULL buffer checks

This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot co

[multiple] reduce redundant NULL buffer checks

This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot code paths.

Most (buffer *) used by lighttpd are not NULL, especially since buffers
were inlined into numerous larger structs such as request_st and chunk.

In the small number of instances where that is not the case, a NULL
check is often performed earlier in a function where that buffer is
later used with a buffer_* func. In the handful of cases that remained,
a NULL check was added, e.g. with r->http_host and r->conf.server_tag.

- check for empty strings at config time and set value to NULL if blank
string will be ignored at runtime; at runtime, simple pointer check
for NULL can be used to check for a value that has been set and is not
blank ("")
- use buffer_is_blank() instead of buffer_string_is_empty(),
and use buffer_is_unset() instead of buffer_is_empty(),
where buffer is known not to be NULL so that NULL check can be skipped
- use buffer_clen() instead of buffer_string_length() when buffer is
known not to be NULL (to avoid NULL check at runtime)
- use buffer_truncate() instead of buffer_string_set_length() to
truncate string, and use buffer_extend() to extend

Examples where buffer known not to be NULL:
- cpv->v.b from config_plugin_values_init is not NULL if T_CONFIG_BOOL
(though we might set it to NULL if buffer_is_blank(cpv->v.b))
- address of buffer is arg (&foo)
(compiler optimizer detects this in most, but not all, cases)
- buffer is checked for NULL earlier in func
- buffer is accessed in same scope without a NULL check (e.g. b->ptr)

internal behavior change:
callers must not pass a NULL buffer to some funcs.
- buffer_init_buffer() requires non-null args
- buffer_copy_buffer() requires non-null args
- buffer_append_string_buffer() requires non-null args
- buffer_string_space() requires non-null arg

show more ...


# 937d83b6 06-Jun-2021 Glenn Strauss <[email protected]>

[core] inline fam_dir_entry buffer 'name' member


# dbe3e236 11-Mar-2021 Glenn Strauss <[email protected]>

[multiple] prefer monotonic time for internal use

Note: monotonic time does not change while VM is suspended

Continue to use real time where required by HTTP protocol, for logging
and for other use

[multiple] prefer monotonic time for internal use

Note: monotonic time does not change while VM is suspended

Continue to use real time where required by HTTP protocol, for logging
and for other user-visible instances, such as mod_status, as well as for
external databases and caches.

show more ...


# ac1fee6b 07-Mar-2021 Glenn Strauss <[email protected]>

[core] adjust stat_cache_get_entry() conditions


Revision tags: lighttpd-1.4.59, lighttpd-1.4.58
# b700a8ca 25-Dec-2020 Glenn Strauss <[email protected]>

[multiple] etag.[ch] -> http_etag.[ch]; better imp

more efficient implementation of HTTP ETag generation and comparison

modify dekhash() to take hash value to allow for incremental hashing


Revision tags: lighttpd-1.4.57, lighttpd-1.4.56
# 1212f609 27-Nov-2020 Glenn Strauss <[email protected]>

buffer_append_path_len() to join paths

use buffer_append_path_len() to join path segments


# 881d0507 17-Dec-2020 Glenn Strauss <[email protected]>

[core] attempt to quiet some coverity warnings


# 1d73fc23 09-Dec-2020 Glenn Strauss <[email protected]>

[core] portability fix if st_mtime not defined


# adf7aea0 08-Dec-2020 Glenn Strauss <[email protected]>

[core] wrap a macro value with parens

(code review)


# 01d49a28 30-Nov-2020 Glenn Strauss <[email protected]>

[core] attempt to quiet some coverity warnings

read() on inotify fd does not return partial records,
and the info from the kernel can be trusted. Still add a sanity check.

If initialization of ino

[core] attempt to quiet some coverity warnings

read() on inotify fd does not return partial records,
and the info from the kernel can be trusted. Still add a sanity check.

If initialization of inotify fails, server will subsequently exit,
so memory leak reported by coverity is insignificant.

show more ...


# 730c932e 16-Nov-2020 Glenn Strauss <[email protected]>

[multiple] more forgiving config str to boolean (fixes #3036)

more consistent use of shared code config_plugin_value_tobool()

(thx tow-conf)

x-ref:
"The on/off keywords in boolean configuration

[multiple] more forgiving config str to boolean (fixes #3036)

more consistent use of shared code config_plugin_value_tobool()

(thx tow-conf)

x-ref:
"The on/off keywords in boolean configuration options is inconsistent, which might be misleading and error-prone."
https://redmine.lighttpd.net/issues/3036

show more ...


# dce44060 05-Nov-2020 Glenn Strauss <[email protected]>

[core] stat_cache preprocessor paranoia


# 520bffcd 05-Nov-2020 Glenn Strauss <[email protected]>

[core] use struct kevent on stack in stat_cache

This alternative approach attempts to work around error:
invalid application of 'sizeof' to incomplete type 'struct kevent'
seen in continuous integ

[core] use struct kevent on stack in stat_cache

This alternative approach attempts to work around error:
invalid application of 'sizeof' to incomplete type 'struct kevent'
seen in continuous integration (CI) autoconf build on FreeBSD VM

show more ...


# 0b00b13a 04-Nov-2020 Glenn Strauss <[email protected]>

[core] use kqueue() instead of FAM/gamin on *BSD

Note: there have always been limitations with lighttpd stat_cache.[ch]
using FAM/gamin on *BSD via kqueue() as lighttpd stat_cache.[ch] only
monitors

[core] use kqueue() instead of FAM/gamin on *BSD

Note: there have always been limitations with lighttpd stat_cache.[ch]
using FAM/gamin on *BSD via kqueue() as lighttpd stat_cache.[ch] only
monitors directories. This kqueue() implementation also only monitors
directories and has limitations.

lighttpd stat_cache.[ch] is notified about additions and removals of
files within a monitored directory but might not be notified of changes
such as timestamps (touch), ownership, or even changes in contents
(e.g. if a file is edited through a hard link)

server.stat-cache-engine = "disable" should be used when files should
not be cached. Full stop. Similarly, "disable" is recommended if files
change frequently. If using server.stat-cache-engine with any engine,
there are caching effects and tradeoffs.

On *BSD and using kqueue() on directories, any change detected clears
the stat_cache of all entries in that directory, since monitoring only
the directory does not indicate which file was added or removed. This
is not efficient for directories containing frequently changed files.

show more ...


1234567