Commit Graph

3964 Commits (fbe55825b417a71e9cced7f977cf5759ebf3bcb2)
 

Author SHA1 Message Date
Glenn Strauss fbe55825b4 [core] consolidate config printing code
funcs use only at startup and only for lighttpd -p
2 years ago
Glenn Strauss 942c2f6722 [core] remove excess counts from print config
remove excess counts from print config
simplify double-quoted string printing
2 years ago
Glenn Strauss 0329e765a3 [core] remove size maint in algo_splaytree
remove size maintenance tracking in algo_splaytree; not used in lighttpd
2 years ago
Glenn Strauss f2aacad079 [core] load padding char from base64_table
(triggers preload-access of table)
2 years ago
Glenn Strauss 3301fe0455 [core] li_base64_dec() on 4 bytes at a time 2 years ago
Glenn Strauss 0dfe9f7b76 [core] merge base64 encoding to li_base64_enc()
single func with option to add padding or not
2 years ago
Glenn Strauss 235c0dca84 [core] base64 encode w/ reduced data dependencies 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 30edc55bb3 [core] adjust some array code (better asm)
slightly reorganize some code for better asm
2 years ago
Glenn Strauss 6836a32c4f [core] omit fdevent select() code if poll() avail
omit fdevent select() code if poll() avail
translate server.event-handler = "select" to "poll" when poll available
2 years ago
Glenn Strauss 7b5ba32a12 [core] tighter OS event poll loops (better asm)
slightly reorganize some code for better asm
2 years ago
Glenn Strauss bac34c1a66 [tests] quite coverity warning in test_request.c 2 years ago
Glenn Strauss 80848d3708 [core] store int* ptr to common gw status counters
(avoid repeated table lookups)
2 years ago
Pavel Gulchuk 2d6c511d23 [core] fix kill workers and shutdown by signal
github: closes #105
2 years ago
Glenn Strauss 0532d67639 [core] document error edge case for HTTP/1.0
When lighttpd is not configured to stream the response body,
lighttpd sends partial content with an incorrect Content-Length
to an HTTP/1.0 client if a backend sends Transfer-Encoding: chunked
in response to lighttpd HTTP/1.1 request (to backend), and the response
from the backend ends up truncated.

lighttpd could instead send an HTTP/1.0 502 Bad Gateway, but the
current implementation chooses to send the partial content.  After all,
an HTTP/1.0 client is, well, HTTP/1.0, and so of limited intelligence.
2 years ago
Glenn Strauss 5ff9e2f6eb [core] remove some (now) unused http_chunk APIs
remove http_chunk_append_file() and http_chunk_append_file_range()

callers should choose to use stat_cache_entry_open() for caching
or should open file and check sizes and ranges
2 years ago
Glenn Strauss 1ce8220947 [core] range chk http_chunk_append_file_ref_range
add range sanity check in http_chunk_append_file_ref_range()
(before potentially sending HTTP/1.1 chunked header)
2 years ago
Glenn Strauss f0da8dd910 [mod_magnet] use http_chunk_append_file_ref_range 2 years ago
Glenn Strauss 1d9fe2a3d6 [mod_flv_streaming] check range before sending FLV
check range before sending FLV header
2 years ago
Glenn Strauss 2663bda37c [core] add option to read config file from stdin
add option to read config file from stdin using: -f -
(with "-" indicating to read config file from stdin)

This was already been possible using temporary files, unlinked and
passed to lighttpd as -f /proc/self/fd/XX (with XX as fd number)
on systems (or containers) in which /proc/self/fd/ is available

Note: using -f - is incompatible with one-shot mode (-1)
since one-shot mode expects stdin to be connected to the client
2 years ago
Glenn Strauss fd0cc46833 [core] remove HANDLER_UNSET enum value 2 years ago
Glenn Strauss bedfd8a78e [mod_*_dbi] fix sqlite3_dbdir spelling in comments
The sqlite3 option is "sqlite3_dbdir"
2 years ago
Glenn Strauss 302d82a59c [core] accept in network_server_handle_fdevent()
merge connection_accept() into network_server_handle_fdevent()

(possible since connection_accepted() was split out from
 connection_accept() a long time ago)
2 years ago
Glenn Strauss 924d3c9bd6 [multiple] mark con->srv_socket a const ptr 2 years ago
Glenn Strauss c964568e25 [core] remove redundant check for max_conns
network_server_handle_fdevent() checks max_conns and is the only
callers of connection_accept(), so connection_accept() does not
need to repeat the check.
2 years ago
Glenn Strauss 7b0bc1298a [core] reorder hook enum for better mem locality 2 years ago
Glenn Strauss 0afab29cfb [core] merge uri_raw and uri_clean hooks
hooks are run consecutively in http_response_prepare()

merge uri_raw before uri_clean to preserve existing ordering
2 years ago
Glenn Strauss 3a9a3716c4 [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
2 years ago
Glenn Strauss 01a9e31227 [cmake] update src/config.h.cmake 2 years ago
Glenn Strauss 21539ec69e [cmake] improve cmake detection of timegm 2 years ago
Glenn Strauss 7a15bfcf04 [mod_auth] include unistd.h for crypt() on *nix
(needed by *BSD in addition to Mac OS)
2 years ago
Glenn Strauss 22e8f600f5 [core] quiet coverity noise 2 years ago
Glenn Strauss f8914ac381 [core] remove excess assertions in buffer_commit()
buffer_commit() is called by routines which preallocate for operations
like read().  The caller must properly manage the memory.  The checks
removed from buffer_commit() are too late.
2 years ago
Glenn Strauss 980554bc70 [core] simplify buffer_path_simplify() 2 years ago
Glenn Strauss b2f4c00784 [core] mark some likely hot paths (better asm)
slightly reorganize some code for better asm
2 years ago
Glenn Strauss 17d9733f6e [core] http_response_prepare() OPTIONS *, CONNECT
special-case OPTIONS * and CONNECT in http_response_prepare()

http_response_prepare() is no longer revisited if r->handler_module
is set, so it is no longer necessary to fill r->physical.path for
CONNECT
2 years ago
Glenn Strauss 325690b039 [core] mark cold paths in http_response_config
HTTP/1.1 is not typically disabled

GET/HEAD are typically the most frequent request types
  and request body is not typically present for GET/HEAD
2 years ago
Glenn Strauss f7bcc83355 [core] buffer_is_equal_string -> buffer_eq_slen 2 years ago
Glenn Strauss 1aae63af62 [core] remove buffer_is_equal_right_len()
(not widely used or widely useful)
2 years ago
Glenn Strauss e0a4a7849f [core] check for Upgrade before h2 upgrade check
(short-circuit if Upgrade header not present)
2 years ago
Glenn Strauss e2bd776f8f [tests] disable secdownload HMAC tests for NSS
NSS crypto lib does not expose interfaces to HMAC funcs
2 years ago
Glenn Strauss 28f1d010d2 [core] improve HTTP/2 behavior w/ max-request-size
improve HTTP/2 behavior when server.max-request-size reached

accept slightly more data than max-request-size if END_STREAM flag recvd

reduce rwin so that client may exceed server.max-request-size, but not
by much.  (client might ignore and might send a firehose of data anyway)
accept up to 64k more data to potentially sink data that was in-flight
beyond the rwin, in order to allow server to send 413 Payload Too Large
before resetting the stream.
2 years ago
Glenn Strauss b288eeafaa [core] http_response_send_file() mark cold paths 2 years ago
Glenn Strauss 2097fe441b [mod_extforward] shared mod_extforward_bad_request 2 years ago
Glenn Strauss 6c40f997b9 [core] merge http_response_send_file 0-size case
merge http_response_send_file 0-sized file special case
(historically was a short-circuit before Range handling,
 but Range handling has been rewritten and moved elsewhere)
2 years ago
Glenn Strauss 4c12d7da08 [core] tighten code in request_check_hostname() 2 years ago
Glenn Strauss 060be714be [mod_auth] include unistd.h for crypt() on Mac OS 2 years ago
Glenn Strauss a473d48c43 [core] consolidate overflow checks in li_to_base64 2 years ago
Glenn Strauss bc572e1c56 [core] base64_charset enum supports only 2 tables 2 years ago
Glenn Strauss 6de4c809c9 [core] buffer_append_base64_encode_opt()
with option to include or omit padding

single func to handle both:
- buffer_append_base64_encode_no_padding
- buffer_append_base64_encode
2 years ago