Commit Graph

4601 Commits (f86b448799fc7f55274a1d61583ff3d390f58e0b)
 

Author SHA1 Message Date
Glenn Strauss e202b187f9 [mod_openssl] libressl v3.5.0 adds ASN1_TIME_diff 1 year ago
Glenn Strauss d05289b1b2 [mod_wolfssl] wolfssl v5.0.0 adds ASN1_TIME_diff()
wolfssl v5.0.0 adds functional wolfSSL_ASN1_TIME_diff()
1 year ago
Glenn Strauss 317b4ba128 [mod_cgi] immed start CGI if Upgrade 1 year ago
Glenn Strauss ce9e0dfc6d [mod_cgi] disable input optim if might Upgrade
(thx pegasus)

disable CGI stdin input optimizations if CGI might Upgrade connection,
since if we upgrade protocols, the original Content-Length -- expected
to be 0 for Upgrade -- does not represent the end of the input.
1 year ago
Glenn Strauss 999457a0e4 [core] adjust when TCP_CORK used on TLS connection 1 year ago
Glenn Strauss b0e43f3bf7 [core] reduce trace on Upgrade backend connection
reduce trace on Upgrade'd backend connection when ECONNRESET received,
which, for example, apparently might occur if a backend calls close()
on socket without first calling shutdown(fd, SHUT_WR) -- seen on Linux
kernel 5.16.15 where lighttpd received ECONNRESET when trying to read()
(instead of receiving EOF).
1 year ago
Glenn Strauss 38a01d98ff [core] ensure socket ready before checking connect
ensure socket ready for writing before checking connect() status

(sanity check in case request gets rescheduled for another reason
 before the socket is ready for writing)
1 year ago
Glenn Strauss fa5e9b5364 [multiple] immed connect to backend for streaming
connect to backend (mod_cgi, mod_proxy, mod_sockproxy, mod_wstunnel)
for streaming request body without waiting for initial data in request
body.  Useful for things like websockets when data starts on server-side
1 year ago
Glenn Strauss 5d1aa5d06f [multiple] WebSockets over HTTP/2 (fixes #3151)
Add support for WebSockets over HTTP/2 to lighttpd core and to
  mod_cgi       w/ config: cgi.upgrade = "enable"
  mod_proxy     w/ config: proxy.header += ("upgrade" => "enable")
  mod_wstunnel

HTTP/2 CONNECT extension defined in RFC8441 is translated to HTTP/1.1
'Upgrade: websocket' requests to mod_cgi or mod_proxy, and is handled
directly in mod_wstunnel.

x-ref:
  WebSockets over HTTP/2
  https://redmine.lighttpd.net/issues/3151
  Bootstrapping WebSockets with HTTP/2
  https://datatracker.ietf.org/doc/html/rfc8441
1 year ago
Glenn Strauss 8fe9f1c053 [core] discard DATA from REFUSED_STREAM at h2 init
discard DATA from REFUSED_STREAM at h2 connection init
while waiting for SETTINGS ackn from client

This is not a bugfix in lighttpd, but rather is a workaround for
impolite/aggressive/dumb/lazy (take your picks) client behavior.

x-ref:
  "POST request DATA part for non-existing URI closes HTTP/2 connection prematurely"
  https://redmine.lighttpd.net/issues/3078
  "HTTP/2 Error"
  https://redmine.lighttpd.net/issues/3148
  "Possible HTTP/2 error - GOAWAY sent"
  https://redmine.lighttpd.net/issues/3149
  "[WAD] HTTP/2 GOAWAY with excessive PUT requests exceeding stream concurrency limit"
  https://redmine.lighttpd.net/boards/2/topics/10351
1 year ago
Glenn Strauss 1f4cc7476d [core] chunkqueue_steal() handle unexpected 0 len
pedantic: chunkqueue_steal() handle unexpected 0 len and 0-length chunks

more code reuse (slightly more instructions) when pwritev not available
1 year ago
Glenn Strauss c6c0873e8a [mod_ssi] check http_chunk_transfer_cqlen for err
pedantic check of http_chunk_transfer_cqlen() for error
1 year ago
Glenn Strauss f82006a0db [mod_mbedtls] use newer mbedtls 3.2.0+ interfaces 1 year ago
Glenn Strauss 54c07b5456 [core] compiler workarounds for very old gcc,glibc
added in gcc 4.6:
  #pragma GCC diagnostic push
  #pragma GCC diagnostic pop
added in gcc 5 (?):
  fix for error: #pragma GCC diagnostic not allowed inside functions

x-ref:
  https://redmine.lighttpd.net/boards/2/topics/10325
1 year ago
Glenn Strauss 75017b72f8 [mod_magnet] allow removal of req_env elt via nil
allow removal of lighty.r.req_env[] element by assigning nil value
(blank values ("") are permitted for environment variables,
 unlike request and response headers)
1 year ago
Glenn Strauss 26e27f140d [TLS] consistent debug.log-ssl-noise config type
(thx flynn)

x-ref:
  https://redmine.lighttpd.net/issues/3146#note-26
1 year ago
Glenn Strauss bd67d9f4ac [core] permit env w/ blank value (fix regression)
(thx Lars Bingchong)

empty env var must be set to blank string and not left unset
(regression in lighttpd 1.4.56 - lighttpd 1.4.64)

x-ref:
  https://stackoverflow.com/a/52913064/1338888
1 year ago
Glenn Strauss e447de1b66 [mod_proxy] adjust handling of legacy X-* headers
append to X-Forwarded-For

overwrite X-Host, X-Forwarded-Host, X-Forwarded-Proto
(with value that might be obtained from trusted downstream proxy
 configured with mod_extforward)
(do not blindly pass through client-provided values, unless
 mod_extforward has been configured to trust the downstream proxy)

(RFC 7239 Forwarded is a standardized header with structured format
 and ought to be preferred over the legacy X-* headers, where available)
1 year ago
Glenn Strauss 18c5f3eb48 [mod_extforward] adjust trust check for HTTP/2
adjust trust check for HTTP/2 streams, as trust is cached at the
connection level, but headers and scheme may need to be overwritten
per-request
1 year ago
Glenn Strauss 0e404df2fb [core] fill in un.sun_path after accept() (fixes #3147)
(thx fstelzer)

x-ref:
  "mod_proxy breaks X-Forwarded-For on requests via unix sockets"
  https://redmine.lighttpd.net/issues/3147
1 year ago
Glenn Strauss 1b56d7cf5b [mod_magnet] lighty.c.header_tokens convenience fn
lighty.c.header_tokens convenience func to create a sequence table
of tokens parsed from a given string, e.g. an HTTP header.  The purpose
of this routine is to made it easier to properly parse an HTTP header
into tokens since token separators can be part of quoted-strings, and
they are not token separators when part of quoted strings.

The sequence table t returned from lighty.c.header_tokens() can be
walked with:
  for i = 1, #t do
    -- <body here>
  end
While walking, each element can be passed to lighty.c.quoteddec()
to decode, as non-quoted-string elements are returned as-is.

Note: lighty.c.header_tokens() returns a sequence table,
      which is different from lighty.c.cookie_tokens(),
      which returns a key/value table of cookies.
1 year ago
Glenn Strauss 94c952bd1c [mod_magnet] magnet_push_quoted_string shared code
(internal) magnet_push_quoted_string() shared code
1 year ago
Glenn Strauss b03fcc7025 [doc] NEWS 1 year ago
Glenn Strauss 8b29653131 [mod_auth] save letter-case diff in require config
(thx dirk4000)

Storing the config list into a data structure with case-insensitive keys
meant that if the config list contained multiple entries which differed
in case-only, then only one entry would survive.  Case-sensitivity of
username matters for HTTP Digest auth.  Store config list in value list.

x-ref:
  "mod_auth (configuration): Change of behavior in user name handling"
  https://redmine.lighttpd.net/boards/2/topics/10275
1 year ago
Glenn Strauss 3ee5b84017 [mod_wolfssl] wolfssl v5.0.0 defines DH_set0_pqg() 1 year ago
Glenn Strauss 96557115cb [core] isolate plugins_*() funcs to main server
(future: might rename plugin.c -> plugins.c since the functions
 contained within are all plugins_*())
1 year ago
Glenn Strauss cc65a21e12 [mod_cgi] cgi.local-redir request_reset thru fnptr
cgi.local-redir call plugins_request_reset through fn ptr

(isolate plugins_* funcs to server;
 should not be called directly from plugins/modules)
1 year ago
Glenn Strauss 29bff8a516 [mod_magnet] fix header,content legacy table clear
fix header,content legacy table clear/reset
(regression since lighttpd 1.4.60)

(newer mod_magnet interfaces in lighttpd 1.4.60 should be preferred
 over legacy lighty.header and lighty.content tables)

Lua does not provide an easy way to (always) get num table elements.
lua_rawlen() is usable only on tables created as a sequence table;
lua_rawlen() might return any lua table "edge", including 0, for other
tables, even if those tables contain entries.  lua_next() must be used
to walk lua tables.
1 year ago
Glenn Strauss 85875e7022 [mod_magnet] lighty.c.quotedenc(),dec() funcs
lighty.c.quotedenc() and lighty.c.quoteddec() convenience functions
to encode and decode MIME quoted-string, e.g. quoted-string formats
in HTTP headers.
1 year ago
Glenn Strauss 072edb9dd8 [mod_magnet] magnet_tmpbuf_acquire(),release()
Prefer r->tmp_buf with lua 5.3+ where r->tmp_buf is quick to access.
Otherwise use chunk_buffer_acquire()/chunk_buffer_release(), which
is also quick, but may be slightly slower.
1 year ago
Glenn Strauss 9727eb1768 [mod_magnet] adjust magnet_lighty_result_get()
rarely used
  e.g. if indexing into the content table before assigning a table
1 year ago
Glenn Strauss 23a5107232 [mod_magnet] remove duplicated NULL checks 1 year ago
Glenn Strauss 36e81d7d7f [mod_magnet] fix lighty.c.urldec_query()
(did not previously work)
1 year ago
Glenn Strauss ef0fe03f2b [mod_magnet] fix lighty.c.cookie_tokens()
(did not previously work)
1 year ago
Glenn Strauss cebe2b004c [mod_magnet] use lua_isnoneornil() in interfaces
prefer lua_isnoneornil() to lua_isnil() in C funcs backing lighty.c.*
interfaces
1 year ago
Glenn Strauss ce360dc6ce [mod_magnet] clear stack when reloading script 1 year ago
Glenn Strauss 40437cef34 [mod_magnet] clear and reuse script-env table
clear and reuse script-env table for script invocations
1 year ago
Glenn Strauss 897b6e664e [mod_magnet] pass lighty table index, defer pops 1 year ago
Glenn Strauss 9e1acfa639 [doc] update external links 1 year ago
Glenn Strauss 95f04a89dd [mod_magnet] keep message handler on stack
keep lua_pcall message handler func (errfunc) on stack for reuse
rather than insert and remove each invocation.
1 year ago
Glenn Strauss de48eaa47e [core] fall back to getauxval(AT_RANDOM), if avail
fall back to use getauxval(AT_RANDOM), if available, for srand() init

getauxval(AT_RANDOM) is a glibc extension
1 year ago
Glenn Strauss 1db7f45e53 [mod_magnet] use lua_getextraspace() to store r
use lua_getextraspace() to store (request_st *)r with lua 5.3+
1 year ago
Glenn Strauss e4d31e1b68 [core] disable keep-alive if forcing HTTP/1.0 resp
If an HTTP/1.1 request is configured to force an HTTP/1.0 response
(server.protocol-http11 = "disable"), then also disable keep-alive
(which is enabled by default in HTTP/1.1).  This overrides the
request header Connection: keep-alive (not re-validated), which is
unlikely to be sent with an HTTP/1.1 request.
1 year ago
Glenn Strauss 2d1b16721c [core] chunk_file_pread() to wrap pread() 1 year ago
Glenn Strauss a2aaf45b7a [mod_magnet] use type returned from lua_getfield()
use type returned from lua_getfield() and lua_getglobal() in lua 5.3+
(remove extra call to lua_type())
1 year ago
Glenn Strauss d79779d830 [mod_magnet] collect chk for magnet lua_State init 1 year ago
Glenn Strauss 647a2a9a25 [mod_magnet] adjust hot path for more inlining 1 year ago
Glenn Strauss 610e885718 [mod_mbedtls] use newer mbedtls 3.2.0+ interfaces 1 year ago
Glenn Strauss 2f13190b58 [mod_magnet] lua_tointegerx() avoids raising error
use lua_tointegerx() instead of luaL_optinteger() to avoid raising error
(lua_tointegerx() was introduced in lua 5.2; fallback provided for <5.2)
1 year ago
Glenn Strauss 5c9eb60c8c [mod_magnet] reset after error attaching content
reset after error raised attaching content

(The lua stack has been unwound after the exception)
(Might avoid reloading script if an alt env is used; not tested)
1 year ago