Glenn Strauss
c8cd7cf49b
[multiple] extern log_epoch_secs
...
replace srv->cur_ts
2 years ago
Glenn Strauss
409bba80b1
[multiple] reduce direct use of srv->cur_ts
2 years ago
Glenn Strauss
50bdb55de8
[multiple] connection hooks no longer get (srv *)
...
(explicit (server *) not passed; available in con->srv)
2 years ago
Glenn Strauss
0fcd51438d
[core] create http chunk header on the stack
...
streamline code in http_chunk.c
2 years ago
Glenn Strauss
010c28949c
[multiple] prefer (connection *) to (srv *)
...
convert all log_error_write() to log_error() and pass (log_error_st *)
use con->errh in preference to srv->errh (even though currently same)
avoid passing (server *) when previously used only for logging (errh)
2 years ago
Glenn Strauss
2ec70f234a
[core] stat_cache_path_contains_symlink use errh
...
use log_error() with con->errh
2 years ago
Glenn Strauss
ed62e354ff
[core] use config_plugin_values_init()
2 years ago
Glenn Strauss
601c572c39
[core] inline buffer as part of data_string value
...
(instead of value being (buffer *))
2 years ago
Glenn Strauss
ad9b7e009b
[core] inline buffer as part of DATA_UNSET key
...
(instead of key being (buffer *))
2 years ago
Glenn Strauss
83535bbef3
[core] differentiate array_get_* for ro and rw
...
array_get_element_klen() is now intended for read-only access
array_get_data_unset() is used by config processing for r/w access
array_get_buf_ptr() is used for r/w access to ds->value (string buffer)
2 years ago
Glenn Strauss
84fb334476
[core] disable stat_cache FAM if FAM conn closed
...
x-ref:
"Lighttpd Stopping suddenly, no apparent reason on the logfile"
https://redmine.lighttpd.net/boards/2/topics/8702
3 years ago
Glenn Strauss
e20b5318d5
[core] use buffer_eq_icase_ssn func
...
specialized buffer_eq_icase_ssn func replace strncasecmp()
in cases where string lengths are known to be at least as
large as the len being compared case-insensitively
3 years ago
Glenn Strauss
49ed72cef4
[core] mark some more funcs w/ __attribute_pure__
3 years ago
Glenn Strauss
146ea6bad0
[mod_webdav] invalidate parent dir in stat_cache
...
invalidate directory in stat_cache when a new file or dir is created
within that directory
3 years ago
Glenn Strauss
9bb01a49df
[core] check if splay_tree NULL before invalidate
3 years ago
Glenn Strauss
d836d20317
[stat_cache] fix compilation error for cmake
3 years ago
Glenn Strauss
84db583e3e
[stat_cache] FAM: whitespace-only change
...
whitespace-only changes in stat_cache_handle_fdevent_in()
3 years ago
Glenn Strauss
60a4b5f118
[stat_cache] FAM: separate routine for FDEVENT_IN
3 years ago
Glenn Strauss
8cc189f4c6
[stat_cache] FAM: improve monitoring, cache 16 sec
...
improve FAM monitoring to use reference counting in internal cache
revalidate entries upon use after 16 sec to recover from missed events
(see comments in commit for more details about limitations)
3 years ago
Glenn Strauss
f56800e86a
[stat_cache] no longer stat() and open() for stat
...
do not open file in stat_cache_get_entry()
no longer stat() followed by open() and close() just for stat()
callers should open() file to validate readability (and then reuse fd)
3 years ago
Glenn Strauss
57470365a2
[stat_cache] interfaces to invalidate entries
3 years ago
Glenn Strauss
f89f9191f4
[stat_cache] FAM: funcs to invalidate entries
3 years ago
Glenn Strauss
c7eaa502ec
[stat_cache] FAM: ignore event with no valid match
3 years ago
Glenn Strauss
18faa0910c
[stat_cache] FAM: check hash collision before add
...
skip monitoring new entry if there is a hash collision in stat_cache
data structure associated with FAM
3 years ago
Glenn Strauss
8772e85cea
[stat_cache] FAM: ignore follow-symlink config
...
no distinction needs to be made whether or not server.follow-symlink set
3 years ago
Glenn Strauss
1971da13db
[stat_cache] FAM: improve handling modified file
3 years ago
Glenn Strauss
38ce790657
[stat_cache] FAM: use entry hash index as userdata
...
Upon receipt of FAM event, validate that entry exists in splaytree
instead of blindly accessing memory through the pointer returned in
userdata by FAM
3 years ago
Glenn Strauss
a3d171526a
[stat_cache] FAM: check FAMNextEvent() return code
3 years ago
Glenn Strauss
cc49703372
[stat_cache] FAM: reduce string copying
3 years ago
Glenn Strauss
a50b72c356
[stat_cache] remove splaytree ins/del debug code
...
remove debug code around for splaytree_insert() and splaytree_delete()
in stat_cache.c
3 years ago
Glenn Strauss
47d006ae47
[stat_cache] pass age param for stat cache cleanup
3 years ago
Glenn Strauss
baa5f04335
[stat_cache] store entries without trailing slash
...
(no more duplication of dir entries with and without trailing slash)
3 years ago
Glenn Strauss
020a83c265
[stat_cache] separate symlink pol from data struct
...
separate symlink polily from internal data structures
no more dup entires in splaytree for allowing/disallowing symlinks
hash name to provided len
3 years ago
Glenn Strauss
73bfee6308
[stat_cache] separate func for symlink policy chk
...
Note: historical ToC-ToU race condition still exists in implementation
server.follow-symlink = "disable" is not recommended (default: "enable")
3 years ago
Glenn Strauss
a15f40a569
[core] replace open() with fdevent_open_cloexec()
...
fdevent_open_cloexec() opens files O_BINARY for consistency,
and with O_NONBLOCK, so that the server will not block if the
target file to open is a fifo.
3 years ago
Glenn Strauss
37bd124ae4
[core] pass conf.follow_symlink in more places
3 years ago
Glenn Strauss
9113011d5b
[core] pass (fdnode *) for registered fdevent fd
...
inline fdevent_fdnode_interest()
avoid array lookup for (fdnode *) for various ops
3 years ago
Glenn Strauss
800e9b7349
[core] remove fde_ndx member outside fdevents
...
(isolated to fdevent framework internals)
3 years ago
Glenn Strauss
7d4ecd01e8
[core] perf: incremental hash of pathname w/o copy
4 years ago
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)
4 years ago
Glenn Strauss
e0dbff4750
[core] slightly simpler flag append to string
4 years ago
Glenn Strauss
bbf01a3a6c
[core] reset var if FAMMonitorDirectory() fails
...
do not read fam_dir->version if FAMMonitorDirectory() fails
4 years ago
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
4 years ago
Glenn Strauss
758d24142b
[core] fix incorrect hash algorithm impl
...
fix incorrect implementation of djb hash algorithm
4 years ago
Glenn Strauss
bd32f67046
[core] open additional fds O_CLOEXEC
4 years ago
Glenn Strauss
b1df38ab6a
[core] increase stat_cache abstraction
...
reduce dependency on struct connection
routines for getting/caching content_type and etag separate from stat
4 years ago
Glenn Strauss
d5d0258362
[core] support POLLRDHUP, where available ( #2743 )
...
x-ref:
"mod_cgi, lighty not killing CGI if connection in the other end is closed"
https://redmine.lighttpd.net/boards/2/topics/5962
"1.4.40/41 mod_proxy, mod_scgi may trigger POLLHUP on *BSD,Darwin"
https://redmine.lighttpd.net/issues/2743
5 years ago
Glenn Strauss
9287c87dcd
[core] cleanup: consolidate FAM code in stat_cache
5 years ago
Glenn Strauss
f97f2e359c
[stat_cache] remove debug code littered in file
5 years ago
Glenn Strauss
685cab057e
[core] rename fd_close_on_exec()
...
rename fd_close_on_exec() to fdevent_setfd_cloexec()
5 years ago