Commit Graph

2782 Commits (a1b527e47374d8432e12c9ff732a944f27dd1365)
 

Author SHA1 Message Date
Glenn Strauss a1b527e473 [multiple] reduce initial buffer sz if large POST (fixes #2922)
reduce initial buffer size if large POST to backend stored in temp files

regression in lighttpd 1.4.52

(thx rgenoud)

x-ref:
  "[regression] lighttpd gets killed after uploading a big file"
  https://redmine.lighttpd.net/issues/2922
5 years ago
Glenn Strauss 4e6ef76406 [tests] update skip count in mod-fastcgi.t 5 years ago
Glenn Strauss 07517ff30a [tests] some test config cleanup
including limiting use of php in tests to mod-fastcgi.t
5 years ago
Glenn Strauss f03e5e239d [tests] t/test_keyvalue
create t/test_keyvalue to replace sparse tests in
  tests/mod-redirect.t and tests/mod-rewrite.t
remove tests/mod-redirect.t and tests/mod-rewrite.t
5 years ago
Glenn Strauss dd11144bc8 [core] use kill_signal for gw_proc_kill()
After 4 seconds, send kill() every second while waiting for child to exit.

Send host->kill_signal for next 4 seconds, then send SIGTERM (usually same
as host->kill_signal) for following 8 seconds, and finally send SIGKILL
each second after that, until the child process dies.

github: closes #94
5 years ago
Glenn Strauss c2a9692e78 [tests] include first.h and NDEBUG early 5 years ago
Glenn Strauss 5a32d0f72a [mod_access] t/test_mod_access
create t/test_mod_access to test mod_access basic logic
remove tests/mod-access.t
5 years ago
Glenn Strauss ddf95741b5 [mod_access] restructure for unit tests 5 years ago
Glenn Strauss 8aad091613 [mod_evhost] t/test_mod_evhost
create t/test_mod_evhost to test mod_evhost basic logic
remove tests/mod-evhost.t
5 years ago
Glenn Strauss 5299bded32 [mod_evhost] restructure for unit tests 5 years ago
Glenn Strauss 093569a6f6 [mod_evhost] split uri handler func for testing 5 years ago
Glenn Strauss b2a6239851 [mod_simple_vhost] t/test_mod_simple_vhost
create t/test_mod_simple_vhost to test mod_simple_vhost basic logic
remove tests/mod-simplevhost.t, which was not testing mod_simple_vhost
5 years ago
Glenn Strauss 685f4ed62c [mod_cml,mod_flv_streaming] fix NULL ptr deref
fix possible NULL pointer dereference when query string not present
and no previous query strings processed by that specific connection
instance

regression in lighttpd 1.4.51 (mod_flv_streaming)
regression in lighttpd 1.4.52 (mod_cml)

workaround for mod_flv_streaming:
  url.rewrite-once = ( "\.flv$" => "${url.path}?" )
(similar workaround for mod_cml)

(thx fab)

x-ref:
  "segfault with mod_flv_streaming"
  https://redmine.lighttpd.net/boards/2/topics/8404
5 years ago
Glenn Strauss 53c231a764 - next is 1.4.53 5 years ago
Glenn Strauss 06ebbc3ed4 [core] invert logic for mod_indexfile load warning 5 years ago
Glenn Strauss e92919788f [mod_webdav] silence warnings if built w/o locks
silence compiler warnings if built w/o locks
5 years ago
Glenn Strauss e0d1528860 [doc] NEWS 5 years ago
Glenn Strauss a7bceb6b06 [core] quiet indexfile warning if mod not loaded 5 years ago
Glenn Strauss 77c01f9817 [core] buffer_append_path_len()
concatenate paths, placing single '/' between strings

reverts broken commit:b9402283

(thx avij)
5 years ago
Glenn Strauss 608026e5aa [core] fix typo 5 years ago
Glenn Strauss fed4573fad [mod_proxy] silence coverity false positive 5 years ago
Glenn Strauss 80638252dc [multiple] validate UTF-8 in url-decoded paths
validate UTF-8 in url-decoded paths obtained elsewhere than from request

(burl_normalize(), if enabled with server.http-parseopts, checks url for
 overlong encodings of ASCII chars in the HTTP request-line)
5 years ago
Glenn Strauss e8e59396d3 [core] reject decoded url-path without leading '/'
buffer_simplify_path() no longer prepends '/' if '/' is missing.
Callers must check for leading '/' depending on use, such as in
concatenation with others paths, or direct use accessing filesystem

Note: lighttpd 1.4.50 provides the server.http-parseopts directive.
Recommended settings unless specific use requires looser settings:
  server.http-parseopts = (
    "header-strict"            => "enable",
    "host-strict"              => "enable",
    "host-normalize"           => "enable",
    "url-normalize"            => "enable",
    "url-normalize-unreserved" => "enable",
    "url-normalize-required"   => "enable",
    "url-ctrls-reject"         => "enable",
    "url-path-2f-decode"       => "enable",
    "url-path-dotseg-remove"   => "enable",
    "url-query-20-plus"        => "enable"
  )

x-ref:
  https://digi.ninja/blog/lighttpd_rewrite_bypass.php

As noted in the link above, mod_access should be preferred instead
of mod_rewrite for access controls to URLs.
5 years ago
Glenn Strauss 8a8579802a [mod_webdav] separate func for each request method
split up mod_webdav_subrequest_handler_huge() into subroutines
5 years ago
Glenn Strauss cef6ee675d [core] limit con->uri.authority < 1024 octets
(expect < 256 octets for DNS name)

Since limit is imposed, can use buffer_clear() instead of buffer_reset()
for con->uri.authority and con->server_name.  (Also, con->uri.scheme is
limited to "http" and "https", so use buffer_clear() for it, too)
5 years ago
Glenn Strauss 0bac13f6b4 [core] cygwin sample to run lighttpd under NSSM
configure NSSM to set environment variables when starting lighttpd
  NSSM_SERVICE_NAME=lighttpd
  NSSM_SERVICE_DIR=/lighttpd/install/dir (optional)
5 years ago
Glenn Strauss ad53c30d4b [core] cygwin helper func for getcwd 5 years ago
Glenn Strauss cf93e91c56 [core] perf: inline buffer_copy_buffer() 5 years ago
Glenn Strauss d7cfc8a381 [mod_wstunnel] use buffer_string_length()
use buffer_string_length() abstraction instead of b->used
5 years ago
Glenn Strauss 75bd40aa5d [core] perf: buffer optimizations
buffer_string_prepare_copy() no longer writes '\0' into b->ptr
buffer_realloc() always allocates extra +1 for '\0'
5 years ago
Glenn Strauss cced512116 [mod_cml] parse query string without modifying it 5 years ago
Glenn Strauss 449274903c [core] perf: simplify buffer_move()
require src and dest to be non-NULL

change no longer releases large swapped buffers with buffer_reset()
5 years ago
Glenn Strauss ef1fdcd910 [mod_webdav] one fewer buffer copy for COPY,MOVE
one fewer buffer copy of Destination for COPY,MOVE
5 years ago
Glenn Strauss 956a3fb9db [mod_webdav] fix LOCK on incorrect URI path 5 years ago
Glenn Strauss b9402283be [core] simpler physical path concatenation 5 years ago
Glenn Strauss ac41c17694 [core] perf: small improvement buffer_string_space 5 years ago
Glenn Strauss a2aba0788b [core] perf: small improvement to encoding CGI var 5 years ago
Glenn Strauss f69bd9cdb8 [core] perf: simple, quick buffer_clear()
quickly clear buffer instead of buffer_string_set_length(b, 0) or
buffer_reset(b).  Avoids free() of large buffers about to be reused,
or buffers that are module-scoped, persistent, and reused.

(buffer_reset() should still be used with buffers in connection *con
 when the data in the buffers is supplied by external, untrusted source)
5 years ago
Glenn Strauss 9749503b1d [core] separate func to reset FILE_CHUNK 5 years ago
Glenn Strauss 19b5fbdd3d [mod_fastcgi] transfer chunks minus packet padding
(thx avij)
5 years ago
Glenn Strauss f0df89a996 [mod_redirect,mod_rewrite] use server_name
use server_name for authority if Host not provided
(Host is not required in HTTP/1.0)
5 years ago
Glenn Strauss b5cd216781 [mod_fastcgi] minor: copy packet without padding 5 years ago
Glenn Strauss 758c58cda5 [core] clear chunk buffer upon release
(before adding back to reusable buffer pool)
5 years ago
Glenn Strauss b74188e5b3 [mod_cgi] reset reused buffer on internal redir 5 years ago
Glenn Strauss aba45f68d8 [core] perf: simpler buffer_string_space() (tests) 5 years ago
Glenn Strauss 473ce93c14 [core] perf: faster HTTP pipelined requests
separate reading header from connection_handle_read_state() into
connection_read_header() so that HTTP pipelined requests can skip
optimistic read()/recv()
5 years ago
Glenn Strauss d1bf435573 [core] perf: simpler buffer_string_space() (fixed) 5 years ago
Glenn Strauss 70d7d0a0a1 [core] server.chunkqueue-chunk-sz = 4096
server.chunkqueue-chunk-sz = 4096 (default)
Can be configured any integral value greater than 0.
Value is rounded up to next 1024 if not an even multiple of 1k.

Sites with large request or response headers may benefit from
an 8k or 16k chunk size.  Embedded systems might choose to minimize
memory use by using a 1k chunk size.
5 years ago
Glenn Strauss cc1c2f0e37 [core] server.compat-module-load = "disable"
controls whether default and compatibility modules are loaded,
including default modules mod_indexfile, mod_staticfile, mod_dirlisting
and if mod_authn* modules are loaded when mod_auth in server.modules
and if mod_openssl is loaded when ssl. directives are seen

default: server.compat-module-load = "enable"
(preserve existing behavior)

recommended config: explicitly load desired modules in desired order
5 years ago
Glenn Strauss 1b8453886f [mod_webdav] quiet coverity false positive 5 years ago