Commit Graph

4005 Commits

Author SHA1 Message Date
Glenn Strauss 13ea2d880b [core] consistent inclusion of sys-time.h 2021-04-28 14:08:29 -04:00
Glenn Strauss a1eba3c89b [core] reuse code to parse backend response
reuse code to parse backend response (http_header_parse_hoff())
2021-04-27 15:13:40 -04:00
Glenn Strauss 3a845f7bec [mod_webdav] quiet pedantic compiler warning 2021-04-27 14:03:06 -04:00
Glenn Strauss 1db8da2fb6 [mod_expire] send only Cache-Control to >=HTTP/1.1
HTTP/1.1 dictates that Cache-Control overrides Expires if both present.
Therefore, send only Cache-Control to HTTP/1.1 requests.  This means
that if an intermediary upgraded the request to HTTP/1.1, and the actual
client sent HTTP/1.0, then the actual client might not understand
Cache-Control when it may have understood Expires.  RFC 2616 HTTP/1.1
was released June 1999, almost 22 years ago (as this comment is written)
If a client today is sending HTTP/1.0, chances are the client does not
cache.  Avoid the overhead of formatting time for Expires to send both
Cache-Control and Expires when the majority of clients are HTTP/1.1 or
HTTP/2 (or later).
2021-04-27 03:04:19 -04:00
Glenn Strauss 6b6252a3ba [core] move timegm() impl inline in sys-time.h
(for systems without timegm())
2021-04-26 12:50:20 -04:00
Glenn Strauss c2feb3e1ad [mod_expire] check for default if mime not found
check for default caching if mime-type not found in expire.mimetypes
2021-04-26 08:59:34 -04:00
Glenn Strauss 885d956edb [core] recognize "enabled"/"disabled" for bool
(in addition to "enable" and "disable")
2021-04-25 15:47:23 -04:00
Glenn Strauss e20e8e4686 [mod_webdav] accept alt syntax in webdav.opts 2021-04-25 15:46:59 -04:00
Glenn Strauss 1d478003d5 [mod_expire] accept time labels without plural 's' 2021-04-25 04:52:41 -04:00
Glenn Strauss a7b95c5b6a [mod_expires,mod_webdav] fix truncated date string
(bug on master branch)
2021-04-24 04:26:07 -04:00
Glenn Strauss 81d18a8e35 [core] discard some HTTP/2 DATA after response (fixes #3078)
(thx oldium)

improve handling of HTTP/2 DATA frames received
a short time after sending response

x-ref:
  "POST request DATA part for non-existing URI closes HTTP/2 connection prematurely"
  https://redmine.lighttpd.net/issues/3078
2021-04-23 07:43:15 -04:00
Glenn Strauss 3392e8fb11 [core] update ls-hpack
LiteSpeed ls-hpack v2.3.0
2021-04-20 22:04:56 -04:00
Glenn Strauss 7d27dd9a72 [mod_nss] define TLSv1_3 as bitflag 2021-04-16 07:07:09 -04:00
Glenn Strauss b2b15d9165 [core] exit 0 upon shutdown if no connections open 2021-04-07 16:31:55 -04:00
Glenn Strauss 84c518ead0 [scons] link lighttpd with pcre for static build 2021-04-07 01:28:51 -04:00
Glenn Strauss 39f6fce7f7 [scons] link lighttpd with pcre for fullstatic 2021-04-07 01:16:51 -04:00
Glenn Strauss f13752f3da [multiple] quiet coverity warnings
includes rejigger of some code in buffer.c for Coverity to have better
visibility into what is happening in internal, private funcs
2021-04-07 01:06:55 -04:00
Glenn Strauss fccf2b768c [mod_dirlisting] ignore error if include file fail
(e.g. continue if include file does not exist)
2021-04-07 00:37:09 -04:00
Glenn Strauss 8e14cdc5c5 [mod_webdav] always define webdav_mmap_file_chunk
(previously was defined only if mod_webdav was built with
PROPPATCH and/or LOCK support)
2021-04-07 00:20:46 -04:00
Glenn Strauss 579045de84 [mod_openssl] issue error trace if < openssl 1.1.1 2021-04-06 22:52:56 -04:00
Glenn Strauss 454ecaa5f9 [TLS] rename ssl.verifyclient.ca-*file options
rename to reflect use for verifying client certificate
(old names are still accepted, but are discouraged)

ssl.ca-file     -> ssl.verifyclient.ca-file
ssl.ca-dn-file  -> ssl.verifyclient.ca-dn-file
ssl.ca-crl-file -> ssl.verifyclient.ca-crl-file
2021-04-06 22:31:08 -04:00
Glenn Strauss 325d89b99f [multiple] more reuse of http_date_time_to_str() 2021-04-05 13:24:51 -04:00
Glenn Strauss c41ebea4bb [build] fix zstd option in meson (fixes #3076)
(thx KimonHoffmann)

x-ref:
  "Fix zstd dependency handling in meson build"
  https://redmine.lighttpd.net/issues/3076
2021-04-05 13:24:51 -04:00
Glenn Strauss 82abd16dd7 [mod_proxy] send HTTP/1.0 to backend if no Host
send HTTP/1.0 request to backend if no Host header sent with request

(If Host header is present with an HTTP/1.0 request from client, then
 lighttpd can still make an HTTP/1.1 request to backends)
2021-04-05 13:24:51 -04:00
Glenn Strauss 20a68d7301 [core] vector.h tweaks 2021-04-05 13:24:51 -04:00
Glenn Strauss 7283c43566 [mod_webdav] limit mem use under extreme condition
limit memory use under extreme conditions (edge cases)
2021-04-05 13:24:51 -04:00
Glenn Strauss c6362e127f [mod_webdav] webdav_log_xml_response()
log XML response from chunkqueue instead of taking single buffer
(webdav.log-xml = "enable")

(prep for future changes)
2021-04-05 13:24:51 -04:00
Glenn Strauss 378bc0343f [mod_dirlisting] dir-listing.cache option
dir-listing.cache = ( "path" => "..."   # path to cache root
                      "max-age" => 15 ) # max age (default 15 sec)

Simple cache of directory listing.  Generating directory listing
on large directives can be expensive.  Cache listing for reuse.

This option is for convenience to improve the performance of
directory listings on busy servers, and requires very little
effort for web server admin to enable.

For even better performance on busy servers, the directory listings
could be (externally) generated into index.html files, and mod_indexfile
could be used instead of mod_dirlisting.  When directories are modified,
an external trigger could regenerate index.html.
2021-04-05 13:24:51 -04:00
Glenn Strauss 94359ac956 [mod_dirlisting] parse query string in javascript
parse (optional) query string in javascript to affect initial list sort
(which is also done in javascript)

This change allows the server-generated page to be cachable,
as the response is now independent of the query string.
2021-04-05 13:24:51 -04:00
Glenn Strauss fa4e2b87c5 [mod_dirlisting] upper limit on parallel dirlist
set upper limit of 1/16 max_conns for parallel dirlist
  (per lighttpd worker)
or else set 503 Service Unavailable with Retry-After: 2

attempt to avoid "livelock" scenarios or starvation of other requests

1/16 max_conns (default 85) is still a high arbitrary limit;
 and limit applies only to directories larger than DIRLIST_BATCH-2
 (DIRLIST_BATCH is currently 32)
2021-04-05 13:24:46 -04:00
Glenn Strauss 8d4da3392c [mod_dirlisting] read dir in pieces; less blocking
read dir in pieces, allowing server to do other work between reads

(avoid potentially blocking other requests for long periods of time
while reading a large directory)
2021-04-02 01:16:42 -04:00
Glenn Strauss 376aea0320 [mod_dirlisting] restructure and keep state
restructure into smaller subroutines and keep persistent state
2021-04-02 01:16:42 -04:00
Glenn Strauss 36e0772984 [mod_dirlisting] process dir in subrequest handler
(precursor to future possible enhancements)
2021-04-02 01:16:42 -04:00
Glenn Strauss 680e6b3bca [multiple] buffer_copy_path_len2() aggregate 2021-04-02 01:16:42 -04:00
Glenn Strauss 262561fae1 [core] ignore empty headers unless pseudo-headers
(thx daex)

(reported on IRC)

x-ref:
  "ignore empty headers unless HTTP/2 pseudo-headers"
  https://redmine.lighttpd.net/boards/2/topics/9720
2021-04-02 01:16:42 -04:00
Glenn Strauss 7a078f567a [core] mark debug path unlikely
mark debug path unlikely
remove redundant debug trace
2021-04-02 01:16:42 -04:00
Glenn Strauss 91b3b3bf90 [core] remove an excess check 2021-04-02 01:16:42 -04:00
Glenn Strauss 9ee17ae2bc [core] mark some chunk.h funcs attr cold 2021-04-02 01:16:42 -04:00
Glenn Strauss 3014a5f8c9 [core] mark select http_kv.[ch] funcs attr nonnull 2021-04-02 01:16:42 -04:00
Glenn Strauss cfc8eeb5a7 [core] mark select buffer.[ch] funcs attr nonnull 2021-04-02 01:16:42 -04:00
Glenn Strauss de40881a2e [core] define __attribute_nonnull__ 2021-04-02 01:16:42 -04:00
Glenn Strauss dc01487ea6 [multiple] use buffer_append_* aggregates
reduces the number of round-trips into some frequently-called routines
2021-04-02 01:16:40 -04:00
Glenn Strauss b4310877ac [core] config_vars_init()
separate func to init config var.CWD and var.PID
using stack for getcwd() result
2021-04-02 01:16:12 -04:00
Glenn Strauss e7464bab9b [core] buffer_append_* aggregates
buffer_append_str2()
buffer_append_str3()
buffer_append_iovec()
2021-04-02 01:16:12 -04:00
Glenn Strauss 82fbfcba15 [build] check for mempcpy() 2021-04-02 01:16:12 -04:00
Glenn Strauss 12acca1887 [core] short-circuit encoding if nothing to encode
short-circuit encoding strings and use memcpy() if nothing to encode
2021-04-02 01:16:12 -04:00
Glenn Strauss 4863c9a63c [multiple] pass len when copying constant strings 2021-04-02 01:16:12 -04:00
Glenn Strauss f608217955 [mod_ssi] use intermediate chunkqueue to aggregate
periodically flush intermediate chunkqueue to r->write_queue
to reduce occurrence of copying to reallocate larger chunk

use chunk_buffer to read ssi file
2021-04-02 01:16:12 -04:00
Glenn Strauss 7c8437a0ec [mod_ssi] shared code to wrap strftime() 2021-04-02 01:16:12 -04:00
Glenn Strauss 6d008a147e [mod_status] double-buffer large output to tmpfile 2021-04-02 01:16:12 -04:00