Commit Graph

3437 Commits

Author SHA1 Message Date
Glenn Strauss c88d373507 [core] Content-Length in http_response_send_file() 2020-10-11 12:19:26 -04:00
Glenn Strauss c3a85c9bf5 [mod_wolfssl] standalone module
standalone module forked from mod_openssl
2020-10-11 12:19:26 -04:00
Glenn Strauss 1d9709b8ab [core] update HTTP status codes list from IANA 2020-10-11 12:19:26 -04:00
Glenn Strauss 38620b10bc [core] cold h2_log_response_header*() funcs 2020-10-11 12:19:26 -04:00
Glenn Strauss 97e314fc9e [multiple] inline chunkqueue_length() 2020-10-11 12:19:26 -04:00
Glenn Strauss 3a766d3d02 [mod_webdav] preserve bytes_out when chunks merged 2020-10-11 12:19:26 -04:00
Glenn Strauss 9f8a896891 [mod_ssi] update chunk after shell output redirect
chunkqueue_update_file() to update size of file chunk after
redirecting shell output to file fd
2020-10-11 12:19:26 -04:00
Glenn Strauss dbd458a0e6 [core] set r->state in h2.c
allow h2.c layer to modify r->state in addition to r->h2state

Do not retire/release r on error if trailers (as opposed to headers)
(stream r was just allocated in the same scope for headers,
 so ok to release)
2020-10-11 12:19:26 -04:00
Glenn Strauss 4474e6117f [core] log stream id with debug.log-state-handling
log stream id with debug.log-state-handling in
connection_state_machine_loop()

(id will be 0 for HTTP/2 connection, but not for streams on connection)
(id will be 0 for HTTP/1.x requests)
2020-10-11 12:19:26 -04:00
Glenn Strauss 05ff9c570e [core] combine Cookie request headers with ';'
(thx avij)

clients should send a single Cookie header with multiple cookie values
separated with ';'.
  https://tools.ietf.org/html/rfc6265#section-4.2.1

However, HTTP/2 loosens this requirement for Cookie.
  https://tools.ietf.org/html/rfc7540#section-8.1.2
  Section 8.1.2.5 Compressing the Cookie Header Field
and some HTTP/2 clients (Chrome, Firefox) send multiple
'cookie:' headers in a HEADERS frame.
2020-10-11 12:19:26 -04:00
Glenn Strauss 37e04510c4 [build] add to autogen.sh hint listing reqd pkgs
add hint to autogen.sh listing packages required for build
  if ./autogen.sh fails
2020-10-11 12:19:26 -04:00
Glenn Strauss 140c0fb8f4 [doc] update README and INSTALL
also add tests/README with some testing notes
2020-10-11 12:19:26 -04:00
Glenn Strauss c946b198a3 [core] code size: disable XXH64(), XXH3()
only XXH32() is used by ls-hpack, so disable XXH64() and XXH3()
to reduce code size.  (This maybe be changed in the future if
XXH64() or XXH3() are utilitized for their performance)
2020-10-11 12:19:26 -04:00
Glenn Strauss a7136aac8e [doc] refresh doc/config/*/* 2020-10-11 12:19:26 -04:00
Glenn Strauss f52a10545a [mod_openssl] clarify trace w/ deprecated options 2020-10-11 12:19:26 -04:00
Glenn Strauss f2e4e83a85 [mod_dirlisting] fix config parsing crash
(bug on master branch; never released)

(thx avij)

update doc that dir-listing.hide-dotfiles = "enable" by default
since lighttpd 1.4.40 https://redmine.lighttpd.net/issues/1081
2020-10-11 12:19:26 -04:00
Glenn Strauss 32d4569512 [core] xxhash no inline hints; let compiler choose 2020-10-11 12:19:26 -04:00
Glenn Strauss a25aeaa2f6 [build] remove ls-hpack/deps
xxHash is provided separately by lighttpd src/algo_xxhash.[ch]
2020-10-11 12:19:26 -04:00
Glenn Strauss 5ec59999dd [build] modify build, includes for xxHash v0.8.0 2020-10-11 12:19:26 -04:00
Glenn Strauss 85c1a1743e [core] import xxHash v0.8.0
import xxhash.[ch] as algo_xxhash.[ch]

https://github.com/Cyan4973/xxHash
tag: v0.8.0 94e5f23e736f2bb67ebdf90727353e65344f9fc0
2020-10-11 12:19:26 -04:00
Glenn Strauss 156e1da2ae [core] rename splaytree.[ch] to algo_splaytree.[ch] 2020-10-11 12:19:26 -04:00
Glenn Strauss 3ffb195532 [core] move djbhash(), dekhash() to algo_md.h 2020-10-11 12:19:26 -04:00
Glenn Strauss 6c8160e5a4 [core] rename md5.[ch] to algo_md5.[ch] 2020-10-11 12:19:26 -04:00
Glenn Strauss 044c8e80e5 [core] use djbhash in gw_backend to choose host
djbhash() is faster and more cache-friendly than is crc32c()
2020-10-11 12:19:26 -04:00
Glenn Strauss ceddd40ad6 [build] fix typo in option description for wolfSSL
(thx avij)
2020-10-11 12:19:26 -04:00
Glenn Strauss a3af9833c6 [core] fix crash on master if blank line request
(bug on master branch; never released)

(thx avij)

fix crash on master if blank line precedes HTTP/1.1 keep-alive request

header parsing code previously made assumptions that request was
HTTP/1.0 or HTTP/1.1, where a request-line was required, and which
would error out elsewhere if request-line was missing.  The parsing
code also previously looked for "\r\n\r\n" to end headers.

The header offset parsing code was modified and invalidated the above
assumptions, now looking only for blank line "\r\n", but the calling
code had not properly been updated.  (until this patch)
2020-10-11 12:19:26 -04:00
Glenn Strauss 5a694281da [core] ls-hpack optimizations
define LSHPACK_DEC_HTTP1X_OUTPUT 0
  lighttpd does not require HTTP/1.1 output compat from HPACK decoder
  ("field-name: value\r\n")

define NDEBUG (in ls-hpack/lshpack.c)
  lighttpd spends upwards of 20% total lighttpd CPU time in HPACK
  encode/decode in h2load test on static file over cleartext (not TLS)
  Defining NDEBUG eliminates some asserts() and results in a small
  but measurable reduction in CPU usage
2020-10-11 12:19:26 -04:00
Glenn Strauss 4656d91889 [core] document algorithm used in lighttpd etag
Donald E. Knuth
The Art Of Computer Programming Volume 3
Chapter 6.4, Topic: Sorting and Search
2020-10-11 12:19:26 -04:00
Glenn Strauss 2cdb862787 [scripts] cert-staple.sh enhancements
support validation from list of multiple signers

attempt to handle older (end-of-life) versions of OpenSSL

(thx avij)
2020-10-11 12:19:26 -04:00
Glenn Strauss 5547530a01 [core] do not require '\0' term for k,v hdr parse
no longer require '\0' terminated z-string for key,value header parsing
  http_request_parse_single_header()
  http_header_str_contains_token()
2020-10-11 12:19:26 -04:00
Glenn Strauss 5fd8a26a75 [core] defer optimization to read small files
defer optimization to read small files into memory until after
response_start hooks have a chance to run, e.g. until after
mod_deflate chooses whether or not to serve file from compressed
cache, if deflate.cache-dir is configured
2020-10-11 12:19:24 -04:00
Glenn Strauss 3baef447b3 [core] fix crash on master after graceful restart
(bug on master branch; never released)

(thx nate)
2020-10-11 11:43:06 -04:00
Glenn Strauss d8b88be056 [core] move connections_get_state to connections.c
connections_get_state() is used only in connections.c for debugging
2020-10-11 11:43:06 -04:00
Glenn Strauss 0f9ec8b755 [mod_status] dedicated funcs for r->state labels
fork connection_get_state() for use by mod_status, which
might in the future choose to display different labels.
move and rename connection_get_short_state() into mod_status,
as the func is used only by mod_status

(connection_get_state() is currently used elsewhere only for debugging
 in connections.c)
2020-10-11 11:43:06 -04:00
Glenn Strauss 878073d1c9 [core] keep pool of (request_st *) for HTTP/2 2020-10-11 11:43:06 -04:00
Glenn Strauss 550609c8ae [core] request_acquire(), request_release()
continue code abstraction for (request_st *)
2020-10-11 11:43:06 -04:00
Glenn Strauss 0905b6f7f9 [core] fix 1-char trunc of default server.tag
(thx avij)
2020-10-11 11:43:06 -04:00
Glenn Strauss cf0098eac8 [mod_auth] fix crash if auth.require misconfigured (fixes #3023)
(thx veyrdite)

x-ref:
  "Segfault with mod_auth & htpasswd (lighttpd.conf misconfig)"
  https://redmine.lighttpd.net/issues/3023
2020-10-11 11:43:06 -04:00
Glenn Strauss cae205ad99 [build] fix meson build 2020-10-11 11:43:06 -04:00
Glenn Strauss 79e2f5baee [core] ignore empty field-name from backends
Empty field-name is already ignored when generating response headers,
but this is an explicit skip of empty field-name sent from backends,
including field-names that look like HTTP/2 pseudo-headers, as those
begin with ':'.
2020-10-11 11:43:06 -04:00
Glenn Strauss 8e2cf55250 [core] redirect to dir using relative-path
Location response header is permitted to use relative-path in
RFC 7231 Section 7.1.2. Location

Prefer relative path in redirection for the benefit of reverse proxies
and CDNs.  Doing so also avoids potentially disclosing internal schemes
and server names which client might not be able to directly reach.

To restore prior behavior of sending a fully-qualified absolute URI:
server.feature-flags += ("absolute-dir-redirect" => "enable")

x-ref:
  https://bz.apache.org/bugzilla/show_bug.cgi?id=63357
2020-10-11 11:43:06 -04:00
Glenn Strauss baa651a3ab [mod_status] adjust to print HTTP/2 requests 2020-10-11 11:43:06 -04:00
Glenn Strauss 9d74aa600b [mod_status] separate funcs to print request table 2020-10-11 11:43:06 -04:00
Glenn Strauss 06df2716f2 [core] comment possible future ls-hpack optimize 2020-10-11 11:43:06 -04:00
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
2020-10-11 11:43:06 -04:00
Glenn Strauss ada09a23b0 [core] h2_send_headers() specialized for resp hdrs
specialized version of http_response_write_header(); send headers
directly to HPACK encoder, rather than double-buffering in chunkqueue
2020-10-11 11:43:06 -04:00
Glenn Strauss 014e5240ef [core] HTTP/2 HPACK using LiteSpeed ls-hpack
(experimental)
2020-10-11 11:43:06 -04:00
Glenn Strauss 70b1af0640 [core] link in ls-hpack (EXPERIMENTAL)
LiteSpeed ls-hpack v2.2.1

XXX: might be better to include this as a git submodule
but minor code changes were made here for portability:
- C99 flexible array members defined as a[] instead of a[0])
- pedantic compiler warnings (excess ';' and missing declarations)
- deletion of large tables from ls-hpack/huff-tables.h (code size)
2020-10-11 11:43:06 -04:00
Glenn Strauss 1bf4555800 [core] update comment 2020-10-11 11:43:06 -04:00
Glenn Strauss 501182dc4b [core] adjust (disabled) debug code 2020-10-11 11:43:06 -04:00