Commit Graph

3537 Commits (fef1a9450976769d6645437b462e8075dffd3542)
 

Author SHA1 Message Date
Glenn Strauss 1c7c19a9d5 [core] skip write throttle for 100 Continue
(small code simplification)
3 years ago
Glenn Strauss 6fc8ad3194 [core] discard 100 102 103 responses from backend 3 years ago
Glenn Strauss 4d9c54f61b [core] mark some error paths with attribute cold 3 years ago
Glenn Strauss 8d7e9439b5 [core] connection transition to HTTP/2; incomplete
(experimental)

(basic framework with some stub functions; incomplete)
(subsequently incrementally updated using git rebase)

HTTP/2 via TLS ALPN extension  (TLS)
HTTP/2 via Upgrade: h2c        (cleartext)
HTTP/2 via Prior Knowledge     (cleartext)

server.feature-flags += ("server.h2proto" => "enable")
to enable HTTP/2
server.feature-flags += ("server.h2c" => "enable")
to enable upgrade to HTTP/2 over cleartext http
3 years ago
Glenn Strauss 784f1ac1da [core] alternate between two joblists
process one joblist and queue work up on second joblist

loop to poll, but poll immediate if work was queued on second joblist
3 years ago
Glenn Strauss 6eca864c5e [core] h2.[ch] with stub funcs (incomplete)
(subsequently incrementally updated using git rebase)

huge props and many thank yous to writers of testing tools used while
developing HTTP/2 support in lighttpd:

  h2spec - conformance testing tool for HTTP/2 implementation
           https://github.com/summerwind/h2spec
  h2load - HTTP/2 benchmarking tool
           https://nghttp2.org/documentation/h2load-howto.html
  curl   - command line tool and library for transferring data with URLs
           https://curl.haxx.se/
3 years ago
Glenn Strauss 2c8f1b4621 [core] isolate more resp code in response.c
http_response_handler() and response generation flow control logic
3 years ago
Glenn Strauss 2f2eec18fb [multiple] isolate more con code in connections.c
move code from connections-glue.c back into connections.c

move code from connections-glue.c to http-header-glue.c
  rename connection_response_reset()
      to http_response_reset()
  rename connection_handle_read_post_error()
      to http_response_reqbody_read_error()
3 years ago
Glenn Strauss 8940fec894 [multiple] modules read reqbody via fn ptr
r->con->reqbody_read() replaces connection_handle_read_post_state()

future: might provide different callbacks for request body with
Content-Length versus request body sent via Transfer-Encoding: chunked
3 years ago
Glenn Strauss 4e4026703d [core] reqpool.[ch] for (request_st *)
move request_init() request_reset() request_free() from connections.c
3 years ago
Glenn Strauss 6971c6c811 [core] move http_request_headers_process()
move http_request_headers_process() to request.[ch]
3 years ago
Glenn Strauss db7b51a4f6 [core] http_header_parse_hoff()
moved and renamed from connections.c:connection_read_header_hoff()
3 years ago
Glenn Strauss 89b3d73daa [core] adjust http_request_headers_process()
adjust for code reuse, and moving routine to lower-level file
3 years ago
Glenn Strauss 517e32785e [core] HTTP2-Settings 3 years ago
Glenn Strauss 4e656f5354 [core] connection_set_fdevent_interest()
extracted from connection_state_machine() (for reuse)

include interest for POLLRDHUP unless already received
3 years ago
Glenn Strauss d4937e29f1 [mod_accesslog,mod_rrdtool] HTTP/2 basic accounting
Note: rrdtool counts do not include HTTP/2 protocol overhead.
Continue to count mod_rrdtool per request rather than per connection
so that data is updated after each request, rather than aggregated
to the end of a potentially long-lived connection with many keep-alives.
3 years ago
Glenn Strauss afc2025d8e [core] reset connection counters per connection
reset connection counters per connection, not per request

adjust mod_accesslog and mod_rrdtool usage

continue to count mod_rrdtool per request rather than per connection
so that data is updated after each request, rather than aggregated
to the end of a potentially long-lived connection with many keep-alives.
3 years ago
Glenn Strauss 8eea3bd014 [core] connection_state_machine_loop()
extracted from connection_state_machine() (for reuse)
3 years ago
Glenn Strauss 68dd6312a2 [core] request_headers_process()
extract code from connection_handle_read_state() for future reuse
3 years ago
Glenn Strauss f37c90bccc [core] parse h2 pseudo-headers 3 years ago
Glenn Strauss 4c699be6c6 [core] recognize status: 421 Misdirected Request 3 years ago
Glenn Strauss 77057a7c02 [core] lowercase response hdr field names for h2 3 years ago
Glenn Strauss e089facf84 [core] do not send Connection: close if h2 3 years ago
Glenn Strauss 21987c863f [mod_extforward] preserve changed addr for h2 con
Preserve changed addr for lifetime of h2 connection; upstream proxy
should not reuse same h2 connection for requests from different clients
3 years ago
Glenn Strauss bbcc2f229a [multiple] allow TLS ALPN "h2" if "server.h2proto" 3 years ago
Glenn Strauss a8f8d5edc0 [core] HTTP_VERSION_2 3 years ago
Glenn Strauss 1041a56dd9 [core] server.feature-flags to enable h2
server.feature-flags = ("server.h2proto" => "enable") to enable h2
3 years ago
Glenn Strauss 96324fbba0 [mod_extforward] skip after HANDLER_COMEBACK
do not re-run mod_extforward uri handler after HANDLER_COMEBACK

add some additional comments
3 years ago
Glenn Strauss 0c7d250034 [mod_extforward] save proto per connection
Even though request headers are per-request, update the proto on the
connection level for trusted (proxy) clients.  Note: the proxy must use
each connection only for a single connection from a single client
(typically true in practice), and not for multiple clients.

proto was previously saved on connection level for mod_extforward with
HAProxy PROXY protocol, but did not occur with X-Forwarded-Proto or the
Forwarded request header with proto=...

Before this change, modules which returned HANDLER_COMEBACK could lose
HTTPS=on if the resulting request was for a backend such as mod_fastcgi.
This was reported in mod_rewrite, but could also affect mod_magnet if
MAGNET_RESTART_REQUEST, or mod_cgi with cgi.local-redir = "enable"

x-ref:
  "FastCGI behavior different when using rewrite?"
  https://redmine.lighttpd.net/boards/2/topics/9293
3 years ago
Glenn Strauss b600b75f20 [core] inline buffer_reset()
buffer_reset() is used on pre-allocated buffers, so remove NULL check
3 years ago
Glenn Strauss e1bb579361 [core] disperse settings.h to appropriate headers 3 years ago
Glenn Strauss 3e046ccabf [core] dlsym for FAMNoExists() for compat w/ fam
gamin should be used instead of fam; fam is no longer maintained

This patch makes it safe to build lighttpd with gamin, but run on
systems with the (deprecated) fam installed, which can happen due
to historical package dependency declarations on some platforms
(Debian, Ubuntu).

gamin and fam are not 100% binary compatible.
(Among other things, fam does not provide FAMNoExists())

x-ref:
  "llibgamin vs libfam conflict solving"
  https://salsa.debian.org/debian/lighttpd/-/merge_requests/18
  "libgamin0: libfam shlib dependency wrongly set to libfam0"
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510368
  "undefined symbol: FAMNoExists"
  https://bugs.launchpad.net/bugs/1453463
3 years ago
Glenn Strauss d2d5f27f80 [core] chunkqueue_compact_mem() must upd cq->last 3 years ago
Glenn Strauss 346280fed7 [mod_proxy] do not forward Expect: 100-continue
do not forward Expect: 100-continue to backend
since we do not handle HTTP/1.1 100 Continue response
3 years ago
Glenn Strauss 8b4abaf498 [mod_webdav] fix fallback if linkat() fails
fix fallback if linkat() fails

check at startup if /proc/self/fd is present on systems with O_TMPFILE
(containers might not mount /proc)

x-ref:
  "mod_webdav - PUT files with < 64kb Content-Length reults in zero length file"
  https://redmine.lighttpd.net/boards/2/topics/9273
3 years ago
Jeff Zignego 3470919212 Add avahi service file under doc/avahi/
github: closes #104
3 years ago
Stefan Bühler 5515bb2a08 scons: fix check environment
if os.environ is a special class the scons.Environment Clone() doesn't
work properly.

show builddir in prepare.sh so we can actually see it works.
3 years ago
Glenn Strauss e012705b43 [build] SCons fix space/tabs inconsistency 3 years ago
Glenn Strauss eb4f953396 [build] avoid accept_filter_arg compiler warning
avoid compiler warning for struct accept_filter_arg af_name strncpy()
3 years ago
Glenn Strauss cea7e92157 [build] SCons brotli needs pkg-config --static
SCons fullstatic build including brotli needs pkg-config --static
3 years ago
Glenn Strauss f358f04bdc [build] SCons build mod_deflate w/ libm for brotli 3 years ago
Glenn Strauss 17b378c00e [build] SCons build with brotli needs -lm on *BSD 3 years ago
Glenn Strauss abfa915d97 [build] fix SCons build for detection of brotli 3 years ago
Glenn Strauss 4663564c8a [mod_authn_dbi,mod_authn_mysql] fix coverity issue 3 years ago
Glenn Strauss 7bc7082d32 [mod_extforward] attempt to quiet Coverity warning 3 years ago
Glenn Strauss 4a1960958a [core] add some missing standard includes 3 years ago
Glenn Strauss b2d7635801 [mod_webdav] fix inadvertent string truncation
(bug on master branch; never released)
3 years ago
Glenn Strauss 0fb391c096 [core] http_header_remove_token() 3 years ago
Glenn Strauss d44a26bfa3 [tests] test_base64.c clear buf vs reset
(can be slightly faster to clear buffer than to reset buffer)
3 years ago
Glenn Strauss f7919c1ae3 [mod_proxy] send HTTP/1.1 requests to backends
For prior behavior (HTTP/1.0 requests to backend), force HTTP/1.0 with:
  server.feature-flags = ("proxy.force-http10" => "enable")
3 years ago