History log of /lighttpd1.4/src/request.c (Results 1 – 25 of 180)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: lighttpd-1.4.69, lighttpd-1.4.68, lighttpd-1.4.67, lighttpd-1.4.66, lighttpd-1.4.65
# f2610d23 03-May-2022 Glenn Strauss <[email protected]>

[multiple] use buffer_append_char()


# 5e0d82dc 30-Apr-2022 Glenn Strauss <[email protected]>

[core] reusable code for r->state strings

convenience macros/functions for display purposes

(historical labels from mod_status are preserved for compatibility)


# 772919f9 28-Mar-2022 Glenn Strauss <[email protected]>

[core] stricter conformance w/ upcoming HTTP/2 rev

stricter conformance with upcoming HTTP and HTTP/2 RFC revisions


# 5d1aa5d0 24-Mar-2022 Glenn Strauss <[email protected]>

[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.head

[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

show more ...


Revision tags: lighttpd-1.4.64, lighttpd-1.4.63, lighttpd-1.4.62, lighttpd-1.4.61
# e78cd765 20-Oct-2021 Glenn Strauss <[email protected]>

[core] combine more dup header processing code

(pedantically, repeating HTTP_HEADER_HTTP2_SETTINGS should be an error,
but ignore the duplicate if it matches the value of the first one seen)


# 92f2ac9b 18-Oct-2021 Glenn Strauss <[email protected]>

[core] thwart h2 request tunnelling

Existing behavior: strict header parsing, strict host parsing, and
basic url normalization are enabled by default in lighttpd, and
protect against h2 request tunn

[core] thwart h2 request tunnelling

Existing behavior: strict header parsing, strict host parsing, and
basic url normalization are enabled by default in lighttpd, and
protect against h2 request tunnelling attempts using invalid chars
in headers.

Keeping strict parsing settings enabled is strongly recommended.

If any are explicitly disabled in lighttpd.conf, then this patch takes
steps to thwart h2 request tunnelling.

x-ref:
"HTTP/2: The Sequel is Always Worse"
https://portswigger.net/research/http2

show more ...


# 438dadde 19-Oct-2021 Glenn Strauss <[email protected]>

[core] separate funcs to check for valid chars

separate funcs to check for valid chars in headers


# e8a6ed6e 18-Oct-2021 Glenn Strauss <[email protected]>

[core] thwart h2c smuggling when Upgrade enabled

Existing behavior: mod_proxy *does not* forward Upgrade header
unless explicitly enabled in lighttpd.conf (default: not enabled)
(proxy.header += (

[core] thwart h2c smuggling when Upgrade enabled

Existing behavior: mod_proxy *does not* forward Upgrade header
unless explicitly enabled in lighttpd.conf (default: not enabled)
(proxy.header += ("upgrade" => "enable"))

mod_cgi previously used to forward Upgrade request header, but would
remove Upgrade response header if cgi.upgrade was not explicitly enabled
(cgi.upgrade = "enable")

This patch thwarts h2c smuggling when lighttpd.conf has also been
explicitly configured to pass "Upgrade" request header

x-ref:
"h2c Smuggling: Request Smuggling Via HTTP/2 Cleartext (h2c)"
https://labs.bishopfox.com/tech-blog/h2c-smuggling-request-smuggling-via-http/2-cleartext-h2c

show more ...


Revision tags: lighttpd-1.4.60
# a407636e 15-Sep-2021 Glenn Strauss <[email protected]>

[core] reject HTTP/2 pseudo-header in trailers (#3102)

(detect if client erroneously reuses stream id for a different request)

x-ref:
"Chrome gives random net::ERR_HTTP2_PROTOCOL_ERROR"
https:/

[core] reject HTTP/2 pseudo-header in trailers (#3102)

(detect if client erroneously reuses stream id for a different request)

x-ref:
"Chrome gives random net::ERR_HTTP2_PROTOCOL_ERROR"
https://redmine.lighttpd.net/issues/3102

show more ...


# 7a21b385 25-Aug-2021 Glenn Strauss <[email protected]>

[core] log_error_multiline()

rename log_error_multiline_buffer() to log_error_multiline()
and take (char *)ptr and (size_t)len instead of (buffer *)b

When debug printing request and response header

[core] log_error_multiline()

rename log_error_multiline_buffer() to log_error_multiline()
and take (char *)ptr and (size_t)len instead of (buffer *)b

When debug printing request and response headers,
print each header on separate line for readability
and omit '\r' if "\r\n" ends line

show more ...


# a3b76ed5 10-Aug-2021 Glenn Strauss <[email protected]>

[core] reuse some cold duplicate hdr match code


# 9a2404ce 13-Jul-2021 Glenn Strauss <[email protected]>

[core] quiet compiler warnings

cast away signedness warning in request_check_hostname()
mod_gnutls https_add_ssl_client_entries crts allocated if crt_size != 0
(which is already checked earlier in

[core] quiet compiler warnings

cast away signedness warning in request_check_hostname()
mod_gnutls https_add_ssl_client_entries crts allocated if crt_size != 0
(which is already checked earlier in routine)

report from FaceBook Infer static analysis tool (https://fbinfer.com/)
- quiet dead store warnings
- check return != NULL from allocation funcs

show more ...


# 9fe8fbaa 20-Jun-2021 Glenn Strauss <[email protected]>

[multiple] http_method_buf()

- http_method_buf() returns (const buffer *)
- comment out unused get_http_status_name()
- inline func for http_append_method()

config processing requires a persistent

[multiple] http_method_buf()

- http_method_buf() returns (const buffer *)
- comment out unused get_http_status_name()
- inline func for http_append_method()

config processing requires a persistent buffer for method on the
off-chance that the config performed a capturing regex match in
$HTTP["method"] condition and used it later (e.g. in mod_rewrite)
(Prior behavior using r->tmp_buf was undefined in this case)

show more ...


# f490078d 15-Jun-2021 Glenn Strauss <[email protected]>

[multiple] buffer_copy_string_len_lc()

convenience wrapper combining
buffer_copy_string_len()
buffer_to_lower()
and making a single pass over string


# 8c5acaae 14-Jun-2021 Glenn Strauss <[email protected]>

[core] lowercase r->http_host, r->uri.authority

always lowercase r->http_host, r->uri.authority for consistency


# 0f90a9e3 14-Jun-2021 Glenn Strauss <[email protected]>

[core] reduce memcmp in http_request_parse_header

extend http_header_parse_ctx to support enum http_header_h2_e
HTTP/2 pseudo-headers in hpctx->id before using memcmp()


# af3df29a 09-Jun-2021 Glenn Strauss <[email protected]>

[multiple] reduce redundant NULL buffer checks

This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot co

[multiple] reduce redundant NULL buffer checks

This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot code paths.

Most (buffer *) used by lighttpd are not NULL, especially since buffers
were inlined into numerous larger structs such as request_st and chunk.

In the small number of instances where that is not the case, a NULL
check is often performed earlier in a function where that buffer is
later used with a buffer_* func. In the handful of cases that remained,
a NULL check was added, e.g. with r->http_host and r->conf.server_tag.

- check for empty strings at config time and set value to NULL if blank
string will be ignored at runtime; at runtime, simple pointer check
for NULL can be used to check for a value that has been set and is not
blank ("")
- use buffer_is_blank() instead of buffer_string_is_empty(),
and use buffer_is_unset() instead of buffer_is_empty(),
where buffer is known not to be NULL so that NULL check can be skipped
- use buffer_clen() instead of buffer_string_length() when buffer is
known not to be NULL (to avoid NULL check at runtime)
- use buffer_truncate() instead of buffer_string_set_length() to
truncate string, and use buffer_extend() to extend

Examples where buffer known not to be NULL:
- cpv->v.b from config_plugin_values_init is not NULL if T_CONFIG_BOOL
(though we might set it to NULL if buffer_is_blank(cpv->v.b))
- address of buffer is arg (&foo)
(compiler optimizer detects this in most, but not all, cases)
- buffer is checked for NULL earlier in func
- buffer is accessed in same scope without a NULL check (e.g. b->ptr)

internal behavior change:
callers must not pass a NULL buffer to some funcs.
- buffer_init_buffer() requires non-null args
- buffer_copy_buffer() requires non-null args
- buffer_append_string_buffer() requires non-null args
- buffer_string_space() requires non-null arg

show more ...


# 3a9a3716 11-May-2021 Glenn Strauss <[email protected]>

[core] adjust r->http_host ptr caching

faster to use http_header_request_set_ptr() and buffer_copy_string_len()
than to use http_header_request_set() and http_header_request_get()

check r->http_hos

[core] adjust r->http_host ptr caching

faster to use http_header_request_set_ptr() and buffer_copy_string_len()
than to use http_header_request_set() and http_header_request_get()

check r->http_host for NULL instead of relying on buffer_copy_* to do so

show more ...


# 980554bc 08-May-2021 Glenn Strauss <[email protected]>

[core] simplify buffer_path_simplify()


# b2f4c007 08-May-2021 Glenn Strauss <[email protected]>

[core] mark some likely hot paths (better asm)

slightly reorganize some code for better asm


# 4c12d7da 05-May-2021 Glenn Strauss <[email protected]>

[core] tighten code in request_check_hostname()


# 262561fa 25-Mar-2021 Glenn Strauss <[email protected]>

[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


# 7a078f56 25-Mar-2021 Glenn Strauss <[email protected]>

[core] mark debug path unlikely

mark debug path unlikely
remove redundant debug trace


# dc01487e 25-Mar-2021 Glenn Strauss <[email protected]>

[multiple] use buffer_append_* aggregates

reduces the number of round-trips into some frequently-called routines


# 19bc8885 15-Mar-2021 Glenn Strauss <[email protected]>

[multiple] add attrs from gcc -Wsuggest-attribute=


12345678