Commit Graph

3868 Commits (9ee17ae2bcf3c2828467bf40715a1497bd357e9b)
 

Author SHA1 Message Date
Glenn Strauss 9ee17ae2bc [core] mark some chunk.h funcs attr cold 2 years ago
Glenn Strauss 3014a5f8c9 [core] mark select http_kv.[ch] funcs attr nonnull 2 years ago
Glenn Strauss cfc8eeb5a7 [core] mark select buffer.[ch] funcs attr nonnull 2 years ago
Glenn Strauss de40881a2e [core] define __attribute_nonnull__ 2 years ago
Glenn Strauss dc01487ea6 [multiple] use buffer_append_* aggregates
reduces the number of round-trips into some frequently-called routines
2 years ago
Glenn Strauss b4310877ac [core] config_vars_init()
separate func to init config var.CWD and var.PID
using stack for getcwd() result
2 years ago
Glenn Strauss e7464bab9b [core] buffer_append_* aggregates
buffer_append_str2()
buffer_append_str3()
buffer_append_iovec()
2 years ago
Glenn Strauss 82fbfcba15 [build] check for mempcpy() 2 years ago
Glenn Strauss 12acca1887 [core] short-circuit encoding if nothing to encode
short-circuit encoding strings and use memcpy() if nothing to encode
2 years ago
Glenn Strauss 4863c9a63c [multiple] pass len when copying constant strings 2 years ago
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
2 years ago
Glenn Strauss 7c8437a0ec [mod_ssi] shared code to wrap strftime() 2 years ago
Glenn Strauss 6d008a147e [mod_status] double-buffer large output to tmpfile 2 years ago
Glenn Strauss 4250de77d3 [mod_trigger_b4_dl] gdbm_reorganize once a day 2 years ago
Glenn Strauss a6d1dccad3 [multiple] strftime %F and %T
strftime %F for %Y-%m-%d, and %T for %H:%M:%S
2 years ago
Glenn Strauss f711207d5c [mod_accesslog] reformat numeric timestamp code 2 years ago
Glenn Strauss 8308915b4e [mod_accesslog] strftime %z for numeric timestamp 2 years ago
Glenn Strauss 069c0fff21 [mod_accesslog] reformat numeric timestamp 2 years ago
Glenn Strauss 4db5c1ec7b [mod_magnet] use http_chunk_* APIs
use http_chunk_* APIs in magnet_attach_content() for consistency
(and sending output to tempfiles if large)
2 years ago
Glenn Strauss 4eeff345b1 [mod_userdir] use 2-element cache
use 2-element cache, can be getpwnam() lookup is expensive

cache lifetime is 60 seconds
homedir paths are not expected to change quickly
2 years ago
Glenn Strauss be8ff83931 [core] buffer_append_strftime() perf annotations 2 years ago
Glenn Strauss 0ffb8167c1 [TLS] use stack for SSL_CLIENT_S_DN_* tag
(reduce use of r->tmp_buf in TLS modules)
2 years ago
Glenn Strauss 250ced26d8 [TLS] https_add_ssl_client_verify_err()
separate routine for printing client certificate verification error

more consistent SSL_CLIENT_M_SERIAL between modules
2 years ago
Glenn Strauss 0bc7e0a3e6 [mod_indexfile] reduce copying of base path 2 years ago
Glenn Strauss 347509261b [mod_userdir] use stat_cache_path_isdir() 2 years ago
Glenn Strauss 26f354cb37 [multiple] http_header APIs to reduce str copies 2 years ago
Glenn Strauss f83ff671fc [mod_dirlisting] limit buffer use for large dirs
send large dir listings to tempfiles
send large header and footers (readme) to tempfiles if XML-encoding

separate header and footer HTML generation from
directory read and HTML generation for dir and files

code reuse, cleanup
reduce some string copying for include file paths
2 years ago
Glenn Strauss 8dc663e86d [mod_cml] use cached time from log_epoch_secs 2 years ago
Glenn Strauss d8f8548fcb [core] use monotonic secs for piped loggers start
use monotonic secs for piped loggers start time
2 years ago
Glenn Strauss 76b9cb8717 [mod_ssi] inline some buffers in ssi plugin_data 2 years ago
Glenn Strauss 9c8b9ff010 [core] move special case for Content-Type CGI hdr
move special case for Content-Type CGI header to identify header with
tag rather than string comparison
2 years ago
Glenn Strauss 160baff923 [core] copy string and len directly from tmp_buf
copy string and len directly from tmp_buf without buffer_commit(tb, ...)
if tmp_buf contents are not used after the copy
2 years ago
Glenn Strauss 0ee964268b [core] restart if large large clock jump detected (#3075)
default is clock jump > 30 mins (1800 seconds)
server.feature-flags += ("server.clock-jump-restart" => 1800)
Can be set to 0 to disable.

x-ref:
  "TLS 1.3 with SessionTicket fail for the first 8 hours of 1970"
  https://redmine.lighttpd.net/issues/3075
2 years ago
Glenn Strauss d50d4dc0e5 [TLS] init STEK even if time is 1970 (fixes #3075)
(thx DamienT)

x-ref:
  "TLS 1.3 with SessionTicket fail for the first 8 hours of 1970"
  https://redmine.lighttpd.net/issues/3075
2 years ago
Glenn Strauss dde9df4310 [multiple] mark addtl funcs attr returns_nonnull 2 years ago
Glenn Strauss a83b5a0121 [core] remove bad prototype from algo_splaytree.h 2 years ago
Glenn Strauss 91adbe7bb1 [core] http_kv.[ch] perf tuning 2 years ago
Glenn Strauss ea38287a4c [multiple] do not clear physical.path if finished
do not reset r->physical.path (unneeded) if returning HANDLER_FINISHED

error handler will reset r->physical.path, if necessary
2 years ago
Glenn Strauss 38c8735850 [multiple] optimize primitives, buffer_extend()
optimize buffer_* primitives

Other than buffer_string_set_length(), reallocate with one power-2 step
in size (or use the requested size, if larger).  This replaces the fixed
BUFFER_PIECE_SIZE round-up of only 64 bytes extension each reallocation,
which could lead to excessive reallocations in some scenarios.

buffer_extend() convenience routine to prep for batch append
(combines buffer_string_prepare_append() and buffer_commit())

mod_fastcgi, mod_scgi, mod_proxy and others now leverage buffer_extend()

mod_scgi directly performs little-endian encoding of short ints

http_response_write_header() optimizes writing response header,
leveraging buffer_extend()

modify mod_proxy to append line ends
similar to how it is done in http_response_write_header()
(removes one call to buffer_append_string_len())
2 years ago
Glenn Strauss f9cd50b782 [core] modify path in-place checking for path-info 2 years ago
Glenn Strauss 81ef66eaf0 [multiple] buffer_has_slash_suffix()
buffer_has_slash_suffix()
buffer_has_pathsep_suffix()
2 years ago
Glenn Strauss 8e093e90f5 [core] http_response_physical_path_error()
consolidate code from error paths in
http_response_physical_path_check() into
http_response_physical_path_error()
2 years ago
Glenn Strauss c636e979e6 [mod_gnutls] quiet clang warning 2 years ago
Glenn Strauss 19bc88850e [multiple] add attrs from gcc -Wsuggest-attribute= 2 years ago
Glenn Strauss fe4310cc61 [mod_dirlisting, mod_trigger_b4_dl] use keyvalue
use keyvalue.[ch] for basic matching

consolidate PCRE logic and leverage PCRE study in keyvalue.[ch]

remove direct link to -lpcre from modules using keyvalue.[ch]
2 years ago
Glenn Strauss 7b9c5adda1 [multiple] PCRE w/ PCRE_STUDY_JIT_COMPILE (fixes #2361)
enabled by default
disable using server.feature-flags += ("server.pcre_jit" => "disable")

Available since pcre-8.20 (2011), and improved in pcre-8.32 (2012),
PCRE_STUDY_JIT_COMPILE can greatly speed up repeated execution of PCRE
patterns.  (https://zherczeg.github.io/sljit/pcre.html)

lighttpd continues to use pcre_exec() instead of pcre_jit_exec(),
even though doing so does not realize all of the performance increase
potentially available with PCRE_STUDY_JIT_COMPILE and pcre_jit_exec().

pcre_jit_exec() is available with PCRE 8.32 and later, if PCRE is
compiled with --enable-jit, but lighttpd does not currently use
pcre_jit_exec() since the PCRE library might not have been compiled
with --enable-jit (though this could be solved with a weak symbol).
Similarly, lighttpd does not currently configure the pcre_jit_stack.

(Using pcre_jit_exec() may be revisited in the future.)

x-ref:
  "add support for pcre JIT"
  https://redmine.lighttpd.net/issues/2361
2 years ago
Glenn Strauss 8845e1e67e [core] defer pcre_compile until after config parse 2 years ago
Glenn Strauss e8de53cb74 [core] fix chunkqueue_small_resp_optim partial rd 2 years ago
Glenn Strauss f5a62a0fd2 [core] http_response_handle_cachable() optim
short-circuit http_response_handle_cachable() if conditional request
headers are not present
2 years ago
Glenn Strauss c035eb7733 [multiple] prefer monotonic time for internal use
(this commit, actually switch to call new func to get monotonic time)
2 years ago