Glenn Strauss
ea6006944b
[mod_auth] http_auth_const_time_memeq improvement
...
employ volatile, which might matter with some compilers (or might not)
explicitly check that string lengths match
(or else might match string where last char of short string matches
repeated chars in longer string)
3 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
c6b46da2c9
[core] retry on some fdevent set/del temporary err
3 years ago
Glenn Strauss
2e7a3c0ac5
[mod_deflate] fix choose encoding parse error ( fixes #2981 )
...
regression in mod_deflate in lighttpd 1.4.54
(thx ocin)
x-ref:
"mod_deflate_choose_encoding() parse error"
https://redmine.lighttpd.net/issues/2981
3 years ago
Glenn Strauss
06a395a93e
[core] issue config error for invalid ':' ( fixes #2980 )
...
x-ref:
"Embedded vim command line in conf file with no comment (#) hangs server"
https://redmine.lighttpd.net/issues/2980
3 years ago
Glenn Strauss
670b2086f8
[core] move con state handling to connections*.c
...
move maint code from server.c to connections.c
3 years ago
Glenn Strauss
b1cc0856d2
[core] fdevent_poll() is effective periodic timer
...
document that USE_ALARM in server.c is not used
3 years ago
Glenn Strauss
5718a471b0
[core] improve http_headers[] data struct packing
3 years ago
Stefan Bühler
7e5dfc1a40
[cmake]: enable CMAKE_POSITION_INDEPENDENT_CODE by default
4 years ago
Stefan Bühler
d7c0fc295f
Also use explicit_memset (NetBSD) with cmake, scons and meson
4 years ago
Stefan Bühler
79760d935a
Use explicit_memset from NetBSD if available for safe_memclear ( fixes #2971 )
4 years ago
Glenn Strauss
186ce8a2b1
[core] allocate unix socket paths with SUN_LEN()+1 ( fixes #2962 )
...
(thx lighthouse2)
x-ref:
"SUN_LEN in sock_addr.c (1.4.53, 1.4.54)"
https://redmine.lighttpd.net/issues/2962
4 years ago
Glenn Strauss
cc492d438b
[core] correct __attribute_pure__ syntax
4 years ago
Glenn Strauss
1300815688
[core] use buffer_eq_icase_ssn func
...
specialized buffer_eq_icase_ssn func replace strncasecmp()
in cases where string lengths are not known to be at least
as large as the len being compared case-insensitively.
(Separate commit in case any future changes modify the
implementation to be unsafe for shorter strings, where
strncasecmp() would stop at '\0' in either string)
4 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
4 years ago
Glenn Strauss
02cd38687b
[core] cold func http_response_omit_header()
4 years ago
Glenn Strauss
075241c773
[mod_webdav] fix startup crash w/ multiple conds ( fixes #2958 )
...
(thx flynn)
x-ref:
"lighttpd 1.4.54 segfaults on start in mod_webdav"
https://redmine.lighttpd.net/issues/2958
4 years ago
Glenn Strauss
72d4fe7451
[core] mark some more funcs w/ __attribute_pure__
4 years ago
Glenn Strauss
fc42ec12d9
[multiple] replace strcasecmp() on short strings
4 years ago
Glenn Strauss
e3874a20ba
[core] use buffer_eq_icase* funcs
...
specialized buffer_eq_icase* funcs replace buffer_caseless_compare()
4 years ago
Glenn Strauss
49ed72cef4
[core] mark some more funcs w/ __attribute_pure__
4 years ago
Glenn Strauss
ac8444f2e6
[core] specialized buffer_eq_*() for short strings
...
specialized buffer_eq_*() funcs for use with short strings,
e.g. case-insensitive comparison for equality
4 years ago
Glenn Strauss
ca059d580d
[core] array-specialized buffer_caseless_compare()
...
specialize buffer_caseless_compare() for array.c
4 years ago
Glenn Strauss
4fb5a791b0
[core] __attribute_pure__
4 years ago
Glenn Strauss
32a8f0b3b5
[core] fix compile error on Solaris ( fixes #2959 )
...
(thx pyhalov)
x-ref:
"Release 1.4.54 does not compile on an Open Solaris clone"
https://redmine.lighttpd.net/issues/2959
4 years ago
Glenn Strauss
ae9cafecea
[mod_authn_ldap] ldap_set_option LDAP_OPT_RESTART ( fixes #2940 )
...
ldap_set_option LDAP_OPT_RESTART to handle EINTR on SIGCHLD from CGI
(ldap uses poll(), which is not restartable with sigaction SA_RESTART)
x-ref:
"mod_authn_ldap/mod_cgi race condition, "Can't contact LDAP server""
https://redmine.lighttpd.net/issues/2940
4 years ago
Glenn Strauss
4ac239c401
[mod_maxminddb] MaxMind GeoIP2 support
4 years ago
Glenn Strauss
ef0a211733
[core] adjust http_chunk read() retry loop
4 years ago
Glenn Strauss
cb1c49a74a
[mod_magnet] expose server addr (local IP) to lua
...
expose server addr (local IP) to lua via
lighty.env["request.server-addr"] (read-only)
4 years ago
Glenn Strauss
42942ec97c
[core] use high precision stat timestamp on OS X
4 years ago
Glenn Strauss
64b0f7229e
[core] buffer_reset() should not be passed NULL
4 years ago
Glenn Strauss
a86ea83b5a
[core] chunkqueue perf: read small files into mem
4 years ago
Glenn Strauss
8ae0646748
[core] chunkqueue perf: skip opening 0-length file
4 years ago
Glenn Strauss
d9e2dd4b2e
[core] chunkqueue perf: specialized buffer.h funcs
4 years ago
Glenn Strauss
6572976e06
[core] chunkqueue perf: code reuse
...
code reuse, simplification, and inlining
remove excess calls to chunkqueue_remove_finished_chunks()
(it may still be possible for there to be an empty chunk in chunkqueue
if nothing were written to a temporary file (need to verify this), so
preserve some calls to chunkqueue_remove_finished_chunks() for now)
4 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
4 years ago
Glenn Strauss
dd3d20c3d0
[mod_webdav] doc Microsoft-WebDAV-MiniRedir bugs
4 years ago
Glenn Strauss
e9abd76acc
[mod_webdav] workaround Microsoft-WebDAV-MiniRedir
...
workaround Microsoft-WebDAV-MiniRedir bugs
4 years ago
Glenn Strauss
9bb01a49df
[core] check if splay_tree NULL before invalidate
4 years ago
Glenn Strauss
003fd0f8c3
[core] store log_state_handling flag on stack
4 years ago
Glenn Strauss
b0ae5fcbcd
[core] support weak etags with If-None-Match
...
support weak etags with If-None-Match
(but require strong etags for Range requests)
4 years ago
Glenn Strauss
1a325a196c
[mod_openssl] use SSL_CTX_set_client_hello_cb()
...
use SSL_CTX_set_client_hello_cb() when available
(obsoletes SSL_CTX_set_tlsext_servername_callback()
and SSL_CTX_set_tlsext_servername_arg())
4 years ago
Glenn Strauss
52c489837f
[build] detect FreeBSD elftc_copyfile()
4 years ago
Glenn Strauss
3abbb8dc4b
[cmake] help cmake on FreeBSD find sys/event.h
...
sys/event.h does not compile standalone, so check_include_files() fails
Add compiler flags -include sys/types.h so that the compile check passes
This allows cmake builds on FreeBSD to detect and use kqueue.
4 years ago
Glenn Strauss
d836d20317
[stat_cache] fix compilation error for cmake
4 years ago
Glenn Strauss
1cf68f79eb
[core] behavior change: stricter URL normalization
...
behavior change: stricter URL normalization
Prior behavior can be obtained by configuring lighttpd.conf with:
server.http-parseopts = (“url-normalize” => “disable” )
although this is not recommended.
This behavior change was pre-announced with the releases of
lighttpd 1.4.52 (2018.11.28)
lighttpd 1.4.53 (2019.01.27)
The recommended settings are:
server.http-parseopts = (
"header-strict" => "enable",
"host-strict" => "enable",
"host-normalize" => "enable",
"url-normalize" => "enable",
"url-normalize-unreserved" => "enable",
"url-normalize-required" => "enable",
"url-ctrls-reject" => "enable",
"url-path-2f-decode" => "enable",
"url-path-backslash-trans" => "enable",
"url-path-dotseg-remove" => "enable",
"url-query-20-plus" => "enable"
)
The lighttpd defaults with this commit are slightly less strict:
server.http-parseopts = (
"header-strict" => "enable",
"host-strict" => "enable",
"host-normalize" => "enable",
"url-normalize" => "enable",
"url-normalize-unreserved" => "enable",
#"url-normalize-required" => "enable",
"url-ctrls-reject" => "enable",
"url-path-2f-decode" => "enable",
#"url-path-backslash-trans" => "enable",
"url-path-dotseg-remove" => "enable",
#"url-query-20-plus" => "enable"
)
4 years ago
Glenn Strauss
77c2883da9
[mod_webdav] quiet coverity warnings
4 years ago
Glenn Strauss
84db583e3e
[stat_cache] FAM: whitespace-only change
...
whitespace-only changes in stat_cache_handle_fdevent_in()
4 years ago
Glenn Strauss
60a4b5f118
[stat_cache] FAM: separate routine for FDEVENT_IN
4 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)
4 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)
4 years ago
Glenn Strauss
44156bbe81
[multiple] open target file earlier in some cases
...
open target file earlier in some cases to validate readability
4 years ago
Glenn Strauss
470a692211
[core] http_chunk_append_file_fd()
4 years ago
Glenn Strauss
8f0adfe043
[core] emit trace using path before clearing path
4 years ago
Glenn Strauss
61e8d799f0
[scons] adjustment for static build under CentOS
...
x-ref:
"Trying to compile under CentOS 6.10"
https://redmine.lighttpd.net/boards/2/topics/8572
4 years ago
Glenn Strauss
338c73fd28
[core] use high precision stat timestamp in etag
...
use high precision stat timestamp (on systems where available) in etag
4 years ago
Glenn Strauss
311f258ab3
[mod_webdav] update stat_cache after file mod
...
update stat_cache entries after file modifications (PUT)
invalidate stat_cache entries after file movement (COPY MOVE DELETE)
4 years ago
Glenn Strauss
57470365a2
[stat_cache] interfaces to invalidate entries
4 years ago
Glenn Strauss
f89f9191f4
[stat_cache] FAM: funcs to invalidate entries
4 years ago
Glenn Strauss
c7eaa502ec
[stat_cache] FAM: ignore event with no valid match
4 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
4 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
4 years ago
Glenn Strauss
1971da13db
[stat_cache] FAM: improve handling modified file
4 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
4 years ago
Glenn Strauss
a3d171526a
[stat_cache] FAM: check FAMNextEvent() return code
4 years ago
Glenn Strauss
cc49703372
[stat_cache] FAM: reduce string copying
4 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
4 years ago
Glenn Strauss
47d006ae47
[stat_cache] pass age param for stat cache cleanup
4 years ago
Glenn Strauss
baa5f04335
[stat_cache] store entries without trailing slash
...
(no more duplication of dir entries with and without trailing slash)
4 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
4 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")
4 years ago
Glenn Strauss
5ac92dca08
[mod_webdav] check If-None-Match ( #1818 )
...
x-ref:
"add RFC-compliant LOCK support to mod_webdav"
https://redmine.lighttpd.net/issues/1818
4 years ago
Glenn Strauss
aacdd3da02
[mod_webdav] special-case If: (<DAV:no-lock>)
...
(recognize <DAV:no-lock>, but supporting logic is limited)
4 years ago
Glenn Strauss
ab005809e1
[mod_webdav] disable elftc_copyfile() on FreeBSD
...
disable elftc_copyfile() on FreeBSD
until libelftc added to SCons static build
4 years ago
Glenn Strauss
278c42abc5
[mod_webdav] platform portability fixes
4 years ago
Glenn Strauss
d4b726bf24
[mod_webdav] provide ETag in more responses
...
When file is already open, fstat() and provide ETag,
e.g. in PUT requests and new LOCK requests (not LOCK refresh)
4 years ago
Glenn Strauss
d334ee5c2f
[mod_webdav] deprecated unsafe partial PUT compat
...
RFC 7231 forbids partial PUT. However, historical versions of
lighttpd mod_webdav did provide this (mis-)feature. Therefore,
provide *deprecated* unsafe partial PUT support for compatibility
with historical lighttpd mod_webdav (prior to mod_webdav rewrite),
but require new config option to enable this compatible behavior:
webdav.opts = ( "deprecated-unsafe-partial-put" => "enable" )
The partial PUT support implemented by historical lighttpd mod_webdav
makes no effort to account for shrinkage or growth of range replaced.
The request body is splat into the *existing* file at the offset
provided which is quite unsafe and can cause corruption in data sent
to concurrent download requests.
Use of this (mis-)feature is discouraged, and support may be removed
in the future, without any further notice.
4 years ago
Glenn Strauss
eee29b65e5
[mod_webdav] check If-Match, If-Unmodified-Since ( #1818 )
...
x-ref:
"add RFC-compliant LOCK support to mod_webdav"
https://redmine.lighttpd.net/issues/1818
4 years ago
Glenn Strauss
3111e24b71
[mod_webdav] clean up resources after do{}while(0)
4 years ago
yangfl
4af0f97f14
[mod_webdav] fix misbehavior on blank nodes in PROPPATCH
...
github: #97
x-ref:
https://github.com/lighttpd/lighttpd1.4/pull/97
4 years ago
yangfl
6962fc2a5a
[mod_webdav] fix uuid detection macro
...
github: #97
x-ref:
https://github.com/lighttpd/lighttpd1.4/pull/97
4 years ago
Glenn Strauss
993cb545d8
[mod_webdav] surround Lock-Token with "<...>"
...
(thx yangfl)
github: #97
x-ref:
https://github.com/lighttpd/lighttpd1.4/pull/97
4 years ago
Glenn Strauss
95aa2c178d
[core] 200 for OPTIONS /non-existent/path HTTP/1.1 ( fixes #2939 )
...
200 for OPTIONS /non-existent/path HTTP/1.1 when a module,
such as mod_webdav, has set Allow response header
x-ref:
"OPTIONS should return 2xx status for non-existent resources if Allow is set"
https://redmine.lighttpd.net/issues/2939
4 years ago
Glenn Strauss
50aae03c31
[mod_webdav] major rewrite ( fixes #1818 )
...
(occurred 3 years ago on experimental branch, and now ported forward)
robustness and performance improvements, including atomic updates on
individual files (e.g. for PUT, COPY, MOVE)
exclusive locks are fully supported
shared locks are partly supported
x-ref:
"add RFC-compliant LOCK support to mod_webdav"
https://redmine.lighttpd.net/issues/1818
4 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.
4 years ago
Glenn Strauss
f1e9bcb08a
[core] new worker_init hook to follow parent fork
4 years ago
Glenn Strauss
4183e723ce
[core] log_error, log_perror using printf-like fmt
4 years ago
Glenn Strauss
cbad7517c8
[core] struct log_error_st for error logging
4 years ago
Glenn Strauss
9eead7db7c
[core] __attribute__((format ...))
4 years ago
Glenn Strauss
0dccda28ad
[core] add const to some etag prototypes
4 years ago
Mohammed Sadiq
6a988bb0d0
[multiple] cleaner calloc use in SETDEFAULTS_FUNC
...
github: closes #99
x-ref:
"cleaner calloc use in SETDEFAULTS_FUNC"
https://github.com/lighttpd/lighttpd1.4/pull/99
4 years ago
Glenn Strauss
599b4f05c8
[core] fix 1.4.52 regression in mem use with POST ( fixes #2948 )
...
(thx rgenoud)
x-ref:
"[regression][Bisected] lighttpd uses way more memory with POST since 1.4.52"
https://redmine.lighttpd.net/issues/2948
4 years ago
Glenn Strauss
e757978497
[core] remove repeated slashes in http-parseopts
...
remove repeated slashes in server.http-parseopts
with url-path-dotseg-remove, including leading "//"
(prior to this patch, leading "//" was skipped)
4 years ago
Glenn Strauss
32120d5b8b
[core] fix abort in http-parseopts ( fixes #2945 )
...
fix abort in server.http-parseopts with url-path-2f-decode enabled
(thx stze)
x-ref:
"Security - SIGABRT during GET request handling with url-path-2f-decode enabled"
https://redmine.lighttpd.net/issues/2945
4 years ago
Glenn Strauss
107fa1f282
[mod_wstunnel] fix ping-interval for big-endian ( fixes #2944 )
...
fix wstunnel.ping-interval for big-endian architectures
(thx ste_p_james)
x-ref:
"[patch] wstunnel.ping-interval ineffective"
https://redmine.lighttpd.net/issues/2944
4 years ago
Glenn Strauss
b135b4d24d
[core] clear FDEVENT_RDHUP if no POLLRDHUP
...
(fix for poll() on FreeBSD 11)
4 years ago
Glenn Strauss
f2ac4cdfc5
[core] off_t upload_temp_file_size
4 years ago
Glenn Strauss
a78404cfbf
[core] fdevent_mkstemp_append() (shared)
4 years ago
Glenn Strauss
97d4c11ba6
[core] __attribute__((fallthrough)) for GCC 7.0
4 years ago
Glenn Strauss
f60f1a279e
[core] extend dir redirection to take HTTP status
...
extend http_response_redirect_to_directory to take HTTP status code
and to set Location if HTTP status >= 300, or else set Content-Location
4 years ago
Glenn Strauss
5440f04e8a
[core] fix assertion with server.error-handler ( fixes #2941 )
...
(thx andpr)
x-ref:
"failed assertion on incoming bad request when server.error-handler option is used"
https://redmine.lighttpd.net/issues/2941
4 years ago
Glenn Strauss
37bd124ae4
[core] pass conf.follow_symlink in more places
4 years ago
Glenn Strauss
2f46736edc
[build] remove -Wdeclaration-after-statement
...
Declarations after statements has been permitted since C99.
(That was 20 years ago!)
4 years ago
Glenn Strauss
8064b7483a
[mod_magnet] fix invalid script return-type crash ( fixes #2938 )
...
(thx flynn)
x-ref:
"Lighttpd crashes on wrong return type in lua script"
https://redmine.lighttpd.net/issues/2938
4 years ago
Glenn Strauss
78f24ba141
[core] silence coverity warning
4 years ago
Glenn Strauss
b9e2be50c9
[mod_auth] HTTP Auth Digest algorithm=SHA-256
...
(also support Digest algorithm=SHA-512-256 if library support present)
enable additional algorithms by configuring lighttpd.conf auth.require
with new optional keyword "algorithm" => "MD5|SHA-256"
default algorithm remains MD5 if "algorithm" not specified
Tested with: curl --digest -u "user:pass" ... (which supports SHA-256)
x-ref:
"HTTP Digest Access Authentication"
https://tools.ietf.org/html/rfc7616
4 years ago
Glenn Strauss
1fb0d7e295
[core] no SOCK_NONBLOCK on QNX 7.0
...
QNX 7.0 has SOCK_CLOEXEC but not SOCK_NONBLOCK
(thx supergaute)
github: closes #98
x-ref:
"Fix compile error when system has SOCK_CLOEXEC but not SOCK_NONBLOCK"
https://github.com/lighttpd/lighttpd1.4/pull/98
4 years ago
Glenn Strauss
28895ab297
[mod_auth] pass http_auth_require_t for 401 Unauth
...
pass (http_auth_require_t *) to mod_auth_send_401_unauthorized_digest()
for configured digest algorithms for 401 Unauthorized
4 years ago
Glenn Strauss
60f4cf3ad8
[mod_auth] http_auth_info_t digest abstraction
4 years ago
Glenn Strauss
07fef25867
[mod_auth] http_auth_digest_hex2bin()
...
replace http_auth_md5_hex2bin() with more generic function to handle
digests of different lengths
4 years ago
Glenn Strauss
9113011d5b
[core] pass (fdnode *) for registered fdevent fd
...
inline fdevent_fdnode_interest()
avoid array lookup for (fdnode *) for various ops
4 years ago
Glenn Strauss
0e108390e5
[core] modify config parser to handle multiple }
...
modify config parser to handle multiple '}' on same line
4 years ago
Glenn Strauss
d76756ca10
[core] perf: pass (fdnode *) to epoll and kqueue
4 years ago
Glenn Strauss
c83fff1dda
[core] release empty chunk buf when nothing read
4 years ago
Glenn Strauss
41384a3657
[core] isolate fdevent processing
4 years ago
Glenn Strauss
1a99aad1c0
[core] pull server load checks out of main loop
4 years ago
Glenn Strauss
99f8ae0d0d
[mod_openssl] use 16k static buffer instead of 64k
...
better match size used by openssl
(avoid unused, oversized reads)
4 years ago
Glenn Strauss
4e6e787a0d
[core] remove redundant check for allow_http11
...
(conf.allow_http11 is handled in http_response_prepare())
4 years ago
Glenn Strauss
800e9b7349
[core] remove fde_ndx member outside fdevents
...
(isolated to fdevent framework internals)
4 years ago
Glenn Strauss
0a46f7ec23
[core] some fdevent code streamlining
...
isolate fde_ndx to fdevent framework internals
4 years ago
Glenn Strauss
8441c9e8e8
[core] config option to allow GET w/ request body
...
server.http-parseopts = ( "method-get-body" = "enable" )
4 years ago
Glenn Strauss
8167497899
[mod_proxy] pass Content-Length to backend if > 0
...
pass Content-Length to backend if > 0, even if GET or HEAD method
(and pass Content-Length: 0 for other methods if no request body)
4 years ago
Glenn Strauss
8efa6a34f4
[mod_openssl] default: ssl.cipher-list = "HIGH"
4 years ago
Glenn Strauss
3e200717cc
[mod_openssl] inherit cipherlist from global scope
...
inherit cipherlist from global scope if not set in $SERVER["socket"]
4 years ago
Glenn Strauss
1542e44bb7
[core] use openssl to read,discard request body
...
use openssl to read,discard request body after response has been sent
on a TLS connection, at least until SSL close notify has been sent
x-ref:
"HTTPS POST upload hangs when i reach maximum supported request size"
https://redmine.lighttpd.net/boards/2/topics/8491
4 years ago
Glenn Strauss
fca9e5a0b1
[core] prefer memchr() over strchr()
4 years ago
Glenn Strauss
fc914ae442
[core] map FDEVENT_* to OS system event frameworks
...
(avoid need to translate event flags between OS and lighttpd FDEVENT_*)
4 years ago
Stefan Bühler
9232145024
[core] poll: fdarray uses fd as index, not fde_ndx
4 years ago
Stefan Bühler
1bd1d559b5
[core] don't call fd event handlers more than once, they might already be gone (fixes segfault)
4 years ago
Glenn Strauss
f5f221eda8
[core] dispatch events from within event framework
...
event framework now calls interface to dispatch events rather than
itself implementing multiple interfaces for fdevent_process() to
be able to dispatch events generically.
4 years ago
Glenn Strauss
9459c05468
[core] fix mixed use of srv->split_vals array ( fixes #2932 )
...
regression in mod_evhost in lighttpd 1.4.53
regression in mod_flv_streaming in lighttpd 1.4.51 - lighttpd 1.4.53
(thx moisseev)
x-ref:
"[regression] %0 pattern does not match hostnames without the domain part"
https://redmine.lighttpd.net/issues/2932
4 years ago
Glenn Strauss
13f957d283
[core] simpler loops to run plugin hooks
4 years ago
Glenn Strauss
c38eddfc29
[core] skip plugins_call_cleanup if not init'ed
4 years ago
Glenn Strauss
b1a9f335c6
[core] connection_handle_write() updates con state
...
(return value was always 0, so remove checks for other values)
4 years ago
Glenn Strauss
4713b6a61c
[core] con->is_ssl_sock
...
flag to indicate if socket protocol is TLS
(future use: will be needed with connection upgrade to https; not impl)
4 years ago
Glenn Strauss
d28bac32fe
[multiple] reduce code dup in list resizing
...
reduce code duplication in list resizing
realloc() of NULL ptr has behavior similar to malloc()
Note that if initial size == 0, then code used to adjust size
must be += x to ensure the size is non-zero for reallocation.
(Multiplying 0 * x, e.g. power-2 resizing, will result in 0.)
4 years ago
Glenn Strauss
31b546e367
[core] fix gw_backend spelling of directive in err
...
fix gw_backend spelling of bin-path directive in error message
4 years ago
Glenn Strauss
74b18c385c
[core] no keep-alive if POLLRDHUP,empty read queue
...
send Connection: close if POLLRDHUP received and read queue is empty
4 years ago
Glenn Strauss
9948537721
[core] discard oversized trailers
...
x-ref:
"PVS-Studio Analysis Results"
https://redmine.lighttpd.net/boards/3/topics/8459
http://www.fly-server.ru/pvs-studio/lighttpd/
4 years ago
Glenn Strauss
b2c18f480d
[mod_auth] minor: adjust config validation
...
x-ref:
"PVS-Studio Analysis Results"
https://redmine.lighttpd.net/boards/3/topics/8459
http://www.fly-server.ru/pvs-studio/lighttpd/
4 years ago
Glenn Strauss
25bb4406fa
[mod_deflate] honor request for x-gzip, x-bzip2
...
honor request for x-gzip, x-bzip2 if gzip, bzip2 not requested
x-ref:
"PVS-Studio Analysis Results"
https://redmine.lighttpd.net/boards/3/topics/8459
http://www.fly-server.ru/pvs-studio/lighttpd/
4 years ago
Glenn Strauss
859c9ae586
[multiple] minor: remove duplicated conditions
...
x-ref:
"PVS-Studio Analysis Results"
https://redmine.lighttpd.net/boards/3/topics/8459
http://www.fly-server.ru/pvs-studio/lighttpd/
4 years ago
Glenn Strauss
daa5f7c576
[mod_accesslog] attempt to reconstruct req line
...
cease http_request_parse_reqline() unconditionally copying request line,
as request line is currently used only by mod_accesslog 'r' format
4 years ago
Glenn Strauss
950832af67
[core] RFC7230 HTTP-version parse
4 years ago
Glenn Strauss
9149b56418
[core] get_http_method_key() match by strlen first
4 years ago
Glenn Strauss
b9a37291cb
[core] lift code out of request line parse loop
4 years ago
Glenn Strauss
e5d61e9a5f
[core] http_request_parse() mark error paths cold
4 years ago
Glenn Strauss
e0a35b75c0
[core] mark log_error_write*() funcs cold
4 years ago
Glenn Strauss
23b0d867c5
[core] replace con->response.keep_alive
...
set con->keep_alive = 0 to indicate backend request to close connection
4 years ago
Glenn Strauss
25185d1de0
[core] pass req hdrs buffer to http_request_parse
4 years ago
Glenn Strauss
7493d628b9
[core] prefer buffer_caseless_compare()
...
prefer buffer_caseless_compare() to strcasecmp()
4 years ago
Glenn Strauss
7f8fd8ad09
[core] make parse_request,request.request same buf
4 years ago
Glenn Strauss
d7ad5819e6
[core] copy request only if might need for logging
...
copy request header only if we may need to log it upon error
4 years ago
Glenn Strauss
a620f80b77
[core] log_request_header_on_error in one place
4 years ago
Glenn Strauss
9ab5469365
[core] parse request in connection_read_header()
4 years ago
Glenn Strauss
8426b94161
[core] perf: optimize connection_read_header()
4 years ago
Glenn Strauss
21afabb8f8
[core] helper funcs for connection_state_machine()
...
carve connection_state_machine() into separate functions per state
4 years ago
Glenn Strauss
9e55fd72b5
[core] quickly clear request buffer for reuse
4 years ago
Glenn Strauss
79aa8613e1
[core] store joblist pointer on stack
4 years ago
Glenn Strauss
b8532fe073
[mod_staticfile] search ext array if not empty
4 years ago
Glenn Strauss
c8f9658536
[core] remove server.h
4 years ago
Glenn Strauss
aa2d0fb087
[core] srv->max_fds_lowat and srv->max_fds_hiwat
4 years ago
Glenn Strauss
653b0dac7c
[core] fdevent_process()
...
process fdevents in fdevent.c
4 years ago
Glenn Strauss
aa34dfd32b
[core] some server_main_loop() cleanup
4 years ago
Glenn Strauss
fb9b8ad8ae
[core] mark startup/shutdown funcs cold
4 years ago
Glenn Strauss
413c0e557e
[core] separate server_main_loop() func, mark hot
...
move server main loop into separate func and mark hot
separate funcs for signal handling
4 years ago
Glenn Strauss
142e54b2a8
[mod_evhost] handle IPv6 literal addr; add tests
4 years ago
Glenn Strauss
2769f19ad3
[mod_openssl] ssl.privkey directive (optional)
...
ssl.privkey can be used to specify path to file containing private key
in lieu of concatenating certificate and private key into single .pem
4 years ago
Martin Storsjö
3ac7764cfe
[core] Fix recursive include_shell invocations
...
When the output of include_shell calls include_shell itself,
that second invocation must not truncate the buffer used for the
outer include_shell.
This might sound like a pathological setup in itself, but with
e.g. debian's include-conf-enabled.pl, which outputs a list of
include statements for all files in /etc/lighttpd/conf-enabled,
if any of the *.conf files in that directory invokes include_shell,
the parsing of the rest of the files in that directory is effectively
aborted.
This fixes a regression since commit
a46bc4f5de
in such setups.
github: closes #95
4 years ago
Glenn Strauss
b17d3c2407
[mod_openssl] ALPN and acme-tls/1 ( fixes #2931 )
...
ssl.acme-tls-1 = "/path/to/dir" containing .crt.pem and .key.pem
named with the SNI name ("<SNI>.crt.pem" and "<SNI>.key.pem")
x-ref:
"Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension"
https://tools.ietf.org/html/rfc7301
"ACME TLS ALPN Challenge Extension" (TLS-ALPN-01)
https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-05
"Support for TLS-ALPN-01"
https://redmine.lighttpd.net/issues/2931
4 years ago
Glenn Strauss
f77cfe7ca8
[core] con->uri.scheme is maintained lowercase
...
con->uri.scheme is maintained lowercase "http" or "https"
so scheme string comparisons need not be case-insensitive
4 years ago
Glenn Strauss
05d20bcac2
[mod_webdav] compare COPY, MOVE Destination scheme
...
compare COPY, MOVE Destination scheme with request URI scheme
4 years ago
Glenn Strauss
b31e7840d5
[multiple] quiet clang --analyze where trivial
...
quiet clang --analyze warnings where trivial to do so
4 years ago
Glenn Strauss
a929de7ae5
[multiple] calloc match ptr type (clang --analyze)
4 years ago
Glenn Strauss
69d17e04cd
[mod_expire] look up expire fallback "" explicitly
...
equivalent to prior code, but more direct (legibile in code) to look up
empty string than to walk array. Might be marginally faster to walk
array when the list is short, but the lookup is also fairly quick in
that case, too.
4 years ago
Glenn Strauss
4608ddec2f
[build] autotools: try mysqlclient.pc and mariadb.pc ( fixes #2925 )
...
(thx helmut)
x-ref:
"autotools cross build failure with lighttpd"
https://redmine.lighttpd.net/issues/2925
4 years ago
Glenn Strauss
ce7b47c015
[core] systemd socket activation support
4 years ago
Glenn Strauss
5b0e27f8ad
[core] network_srv_sockets_append() shared code
4 years ago
Glenn Strauss
6b77372ae7
[core] move /dev/stdin graceful restart handling
...
move /dev/stdin graceful restart handling special-case up out of
network_server_init()
4 years ago
Glenn Strauss
b2ee667a3d
[core] move winsock init to network_init()
4 years ago
Glenn Strauss
a70cf6e5dc
[core] cache rev DNS for localhost for dir redir
4 years ago
Glenn Strauss
629b16f188
[core] send Connection: close if reqbody not read ( fixes #2924 )
...
send Connection: close if it is known that request body has not finished
being read and will not finish being read
x-ref:
"Suboptimal keep-alive handling when request body is not read"
https://redmine.lighttpd.net/issues/2924
4 years ago
Glenn Strauss
96061c1e5e
[mod_auth] permit additional auth backends to load
...
(For testing purposes, allow for all current auth module backends
to be loaded and registered at the same time)
4 years ago
Glenn Strauss
ed6b894127
[core] define MD5_DIGEST_LENGTH 16
4 years ago
Glenn Strauss
e47ea5e2b0
[core] memeq compare rounded to 64, not next 1M
4 years ago
Glenn Strauss
b541b67459
[core] use con->server_name for dir redir
...
use con->server_name for dir redir if con->server_name is not empty
and Host header not provided in request.
4 years ago
Glenn Strauss
81dfa7a8d2
[core] http_response_buffer_append_authority()
...
(shared code)
4 years ago
Glenn Strauss
bceeac654e
[core] use connected sock port in dir redirect
4 years ago
Glenn Strauss
c2bd063ac4
[core] do not free() reused buffer
4 years ago
Glenn Strauss
8ed98ad089
[core] perf: reuse buffer to redirect to directory
4 years ago
Glenn Strauss
7d4ecd01e8
[core] perf: incremental hash of pathname w/o copy
4 years ago
Glenn Strauss
fe3dc17968
[mod_fastcgi] fix NULL ptr deref from bugfix #2922 ( fixes #2923 )
...
(thx rgenoud)
x-ref:
"SIGSEGV on file upload"
https://redmine.lighttpd.net/issues/2923
4 years ago
Glenn Strauss
a1b527e473
[multiple] reduce initial buffer sz if large POST ( fixes #2922 )
...
reduce initial buffer size if large POST to backend stored in temp files
regression in lighttpd 1.4.52
(thx rgenoud)
x-ref:
"[regression] lighttpd gets killed after uploading a big file"
https://redmine.lighttpd.net/issues/2922
4 years ago
Glenn Strauss
f03e5e239d
[tests] t/test_keyvalue
...
create t/test_keyvalue to replace sparse tests in
tests/mod-redirect.t and tests/mod-rewrite.t
remove tests/mod-redirect.t and tests/mod-rewrite.t
4 years ago
Glenn Strauss
dd11144bc8
[core] use kill_signal for gw_proc_kill()
...
After 4 seconds, send kill() every second while waiting for child to exit.
Send host->kill_signal for next 4 seconds, then send SIGTERM (usually same
as host->kill_signal) for following 8 seconds, and finally send SIGKILL
each second after that, until the child process dies.
github: closes #94
4 years ago
Glenn Strauss
c2a9692e78
[tests] include first.h and NDEBUG early
4 years ago
Glenn Strauss
5a32d0f72a
[mod_access] t/test_mod_access
...
create t/test_mod_access to test mod_access basic logic
remove tests/mod-access.t
4 years ago
Glenn Strauss
ddf95741b5
[mod_access] restructure for unit tests
4 years ago
Glenn Strauss
8aad091613
[mod_evhost] t/test_mod_evhost
...
create t/test_mod_evhost to test mod_evhost basic logic
remove tests/mod-evhost.t
4 years ago
Glenn Strauss
5299bded32
[mod_evhost] restructure for unit tests
4 years ago