Commit Graph

95 Commits (96fd7e5d04d4e5cb609c876eae4176aa6cf2d7a5)

Author SHA1 Message Date
Glenn Strauss 96fd7e5d04 [multiple] remove r->physical.etag
(no longer used; was used as temporary buffer)
1 year ago
Glenn Strauss 863551cd8d [tests] t/test_mod_ssi adjust to follow symlinks
t/test_mod_ssi adjust to follow symlinks

/tmp may be a symlink on MacOS
1 year ago
Glenn Strauss c378e3ad8c [core] allocate pcre output vector on demand
allocate pcre output vector on demand for saved config captures
(similar to what is done in lighttpd for pcre2 support)
1 year ago
Glenn Strauss 7512d82ca4 [core] pcre2 support (--with-pcre2)
x-ref:
  "lighttpd: depends on obsolete pcre3 library"
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000063
1 year ago
Glenn Strauss 6d47d4c699 [core] use stack w/ pcre_exec unless save captures
use stack w/ pcre_exec unless saving captures from config conditions

reduce memory allocations per request where lighttpd.conf does not
contain url.redirect or url.rewrite rules where replacements reference
a match of the enclosing lighttpd.conf condition (e.g. %0, %1, %2 ...)

move cond_cache_t 'patterncount' to cond_match_t 'captures'
While cond_match_t is no longer sized power-2, it is generally expected
to be used much less frequently than before (which was all the time),
since it is now used only with url.redirect or url.rewrite with
references %0, %1, %2, ...
1 year ago
Glenn Strauss bab0e5d084 [tests] combine tests into test_common.c
combine common components tests into test_common.c

combine into a single executable to reduce compilation/link redundancy
1 year ago
Glenn Strauss 8e4cf2231e [tests] t/test_mod_evasive.c 1 year ago
Glenn Strauss 251f97bf4f [tests] t/test_mod_alias.c 1 year ago
Glenn Strauss 9b3fa6eb2b [tests] t/test_mod now runs all t/test_mod_*.c
combine into a single executable to reduce compilation/link redundancy
1 year ago
Glenn Strauss 741513ecd1 [mod_ssi] merge mod_ssi_expr.c into mod_ssi.c
isolate this ancient relic
1 year ago
Glenn Strauss 457362cbe3 [mod_ssi] remove mod_ssi parser generator file 1 year ago
Glenn Strauss 8c7b86a316 [tests] reenable test_mod_ssi in cmake
(Instead, workaround added for libtool)
(There must be better ways to do this, but I don't know them right now)
1 year ago
Glenn Strauss ec52917755 [core] fdevent_impl.c separate from fdevent.c 1 year ago
Glenn Strauss 84449e1497 [tests] t/test_mod_ssi 1 year ago
Glenn Strauss 7b615d5d24 [multiple] de-dup file and piped loggers (fixes #3101)
de-dup file and piped loggers for error logs and access logs

x-ref:
  "RFE: de-dup file and piped loggers"
  https://redmine.lighttpd.net/issues/3101
2 years ago
Glenn Strauss a3e9faa479 [multiple] quiet coverity warnings 2 years ago
Glenn Strauss ca2898f678 [tests] t/test_mod_indexfile
also remove some now-redundant tests from request.t
and reduce scripts and directories under tests
(because automake is sloooow and the fewer dirs, the better)
2 years ago
Glenn Strauss 91472ab768 [tests] t/test_mod_staticfile
move some tests from tests/request.t to src/t/test_mod_staticfile.c
2 years ago
Glenn Strauss a0a8cf821d [tests] mv tests from request.t to test_request.c
move some tests from tests/*.t to src/t/test_request.c
2 years ago
Glenn Strauss d4f43f7e1b [tests] update t/test_request.c
use http_header_request_get() in tests to retrieve request headers
2 years ago
Glenn Strauss 4b9da9f1e8 [core] parse $HTTP["remote-ip"] CIDR mask at start
parse $HTTP["remote-ip"] CIDR mask into structured data at startup

note: adds buffer_move() to configparser.y to reduce memory copying
for all config values, and is required for remote-ip to preserve the
structured data added after the config value string.  (Alternatively,
could have normalized the remote-ip value after copying into dc->string)
2 years ago
Glenn Strauss e7805dbf93 [core] base64 encode round-up for required space
no need for extra work for precision allocation to avoid 0-3 extra chars

note: callers passing precise buffer size for without padding will need
  to be modified to pass a slightly larger buffer, e.g. mod_secdownload
2 years ago
Glenn Strauss bac34c1a66 [tests] quite coverity warning in test_request.c 2 years ago
Glenn Strauss 22e8f600f5 [core] quiet coverity noise 2 years ago
Glenn Strauss 980554bc70 [core] simplify buffer_path_simplify() 2 years ago
Glenn Strauss 347509261b [mod_userdir] use stat_cache_path_isdir() 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 5ccebbf04e [multiple] quiet some clang-analyzer warnings 2 years ago
Glenn Strauss f846a392d5 [multiple] use stat_cache_path_isdir() 2 years ago
Glenn Strauss 8fc8ab891a [core] http_request_parse_header() specialized
http_request_parse_header() specialized for HTTP/2 request headers
to be parsed as each field-name and value is HPACK-decoded; send headers
directly from HPACK decoder, rather than double-buffering in chunkqueue

http_request_headers_process_h2() for post-processing
2 years ago
Glenn Strauss 6971c6c811 [core] move http_request_headers_process()
move http_request_headers_process() to request.[ch]
3 years ago
Glenn Strauss d44a26bfa3 [tests] test_base64.c clear buf vs reset
(can be slightly faster to clear buffer than to reset buffer)
3 years ago
Glenn Strauss 28f1867c11 quiet clang analyzer scan-build warnings
(expansion of buffer_string_lenth() inline function and CONST_BUF_LEN()
 macro, which always check for NULL, appears to cause the analyzer to
 believe that a pointer might be NULL in cases where it otherwise can
 not be NULL)

x-ref:
  http://clang-analyzer.llvm.org/faq.html
3 years ago
Glenn Strauss 9fdf24468d [doc] src/t/README 3 years ago
Glenn Strauss 17e0b6fe30 [tests] use buffer_eq_slen() for str comparison
(substitute buffer_eq_slen() for buffer_is_equal_string())
3 years ago
Glenn Strauss c8a1cba0c1 [tests] t/test_mod_userdir
create t/test_mod_userdir to replace sparse tests in tests/mod-userdir.t
remove tests/mod-userdir.t
3 years ago
Glenn Strauss 8b7e110973 [tests] stub out config funcs in test_mod_* 3 years ago
Glenn Strauss 7c7f8c467c [multiple] split con, request (very large change)
NB: r->tmp_buf == srv->tmp_buf (pointer is copied for quicker access)

NB: request read and write chunkqueues currently point to connection
    chunkqueues; per-request and per-connection chunkqueues are
    not distinct from one another
      con->read_queue  == r->read_queue
      con->write_queue == r->write_queue

NB: in the future, a separate connection config may be needed for
    connection-level module hooks.  Similarly, might need to have
    per-request chunkqueues separate from per-connection chunkqueues.
    Should probably also have a request_reset() which is distinct from
    connection_reset().
3 years ago
Glenn Strauss 8131e4396d [core] move addtl request-specific struct members 3 years ago
Glenn Strauss 3648d2908e [core] t/test_request.c using (request_st *)
further isolate t/test_request.c tests to use (request_st *)
3 years ago
Glenn Strauss af5df35275 [core] rename content_length to reqbody_length
rename content_length to reqbody_length in request,
to more easily differentiate request body length
from response content_length
3 years ago
Glenn Strauss 8c46768d5b [core] remove unused request_st member 'request' 3 years ago
Glenn Strauss 6870b0f55b [core] pass (request_st *) to request.c funcs
instead of (struct connection *)
3 years ago
Glenn Strauss 6748a58cca [core] pass scheme port to http_request_parse()
con->proto_default_port is a property of the connection,
which influences the default port used in host normalization
3 years ago
Glenn Strauss 1dd58c5ad8 [multiple] con->proto_default_port 3 years ago
Glenn Strauss 68d8d4c532 [multiple] stat_cache singleton 3 years ago
Glenn Strauss c8cd7cf49b [multiple] extern log_epoch_secs
replace srv->cur_ts
3 years ago
Glenn Strauss 409bba80b1 [multiple] reduce direct use of srv->cur_ts 3 years ago
Glenn Strauss 50bdb55de8 [multiple] connection hooks no longer get (srv *)
(explicit (server *) not passed; available in con->srv)
3 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)
3 years ago