Glenn Strauss
ec2ff2c6ae
[core] perf: connection_read_header_more()
...
additional header parsing optimization
collect request headers into single buffer for parsing
2 years ago
Glenn Strauss
46d7e9c2ed
[core] no need to pass srv to connection_set_state
2 years ago
Glenn Strauss
63e32e8100
[core] perf: HTTP header parsing using \n offsets
2 years ago
Glenn Strauss
fcd1f57511
[core] connection_chunkqueue_compact()
2 years ago
Glenn Strauss
c22ec74770
[core] do not pass srv to http header parsing func
...
srv is retrieved from con->srv in the few cases where needed
2 years ago
Glenn Strauss
80d12919d1
[core] replace connection_set_state w/ assignment
...
replace connection_set_state() with simple assignment
(only connections.c and connections-glue.c should change con state)
2 years ago
Glenn Strauss
be6964f415
[core] use func rc to indicate done reading header
2 years ago
Glenn Strauss
1334436394
[core] store struct server * in struct connection
2 years ago
Glenn Strauss
670b2086f8
[core] move con state handling to connections*.c
...
move maint code from server.c to connections.c
3 years ago
Glenn Strauss
6572976e06
[core] chunkqueue perf: code reuse
...
code reuse, simplification, and inlining
remove excess calls to chunkqueue_remove_finished_chunks()
(it may still be possible for there to be an empty chunk in chunkqueue
if nothing were written to a temporary file (need to verify this), so
preserve some calls to chunkqueue_remove_finished_chunks() for now)
3 years ago
Glenn Strauss
003fd0f8c3
[core] store log_state_handling flag on stack
3 years ago
Glenn Strauss
cbad7517c8
[core] struct log_error_st for error logging
3 years ago
Glenn Strauss
5440f04e8a
[core] fix assertion with server.error-handler ( fixes #2941 )
...
(thx andpr)
x-ref:
"failed assertion on incoming bad request when server.error-handler option is used"
https://redmine.lighttpd.net/issues/2941
3 years ago
Glenn Strauss
9113011d5b
[core] pass (fdnode *) for registered fdevent fd
...
inline fdevent_fdnode_interest()
avoid array lookup for (fdnode *) for various ops
3 years ago
Glenn Strauss
4e6e787a0d
[core] remove redundant check for allow_http11
...
(conf.allow_http11 is handled in http_response_prepare())
3 years ago
Glenn Strauss
800e9b7349
[core] remove fde_ndx member outside fdevents
...
(isolated to fdevent framework internals)
3 years ago
Glenn Strauss
1542e44bb7
[core] use openssl to read,discard request body
...
use openssl to read,discard request body after response has been sent
on a TLS connection, at least until SSL close notify has been sent
x-ref:
"HTTPS POST upload hangs when i reach maximum supported request size"
https://redmine.lighttpd.net/boards/2/topics/8491
3 years ago
Glenn Strauss
fca9e5a0b1
[core] prefer memchr() over strchr()
4 years ago
Glenn Strauss
b1a9f335c6
[core] connection_handle_write() updates con state
...
(return value was always 0, so remove checks for other values)
4 years ago
Glenn Strauss
4713b6a61c
[core] con->is_ssl_sock
...
flag to indicate if socket protocol is TLS
(future use: will be needed with connection upgrade to https; not impl)
4 years ago
Glenn Strauss
74b18c385c
[core] no keep-alive if POLLRDHUP,empty read queue
...
send Connection: close if POLLRDHUP received and read queue is empty
4 years ago
Glenn Strauss
daa5f7c576
[mod_accesslog] attempt to reconstruct req line
...
cease http_request_parse_reqline() unconditionally copying request line,
as request line is currently used only by mod_accesslog 'r' format
4 years ago
Glenn Strauss
950832af67
[core] RFC7230 HTTP-version parse
4 years ago
Glenn Strauss
e5d61e9a5f
[core] http_request_parse() mark error paths cold
4 years ago
Glenn Strauss
23b0d867c5
[core] replace con->response.keep_alive
...
set con->keep_alive = 0 to indicate backend request to close connection
4 years ago
Glenn Strauss
25185d1de0
[core] pass req hdrs buffer to http_request_parse
4 years ago
Glenn Strauss
7f8fd8ad09
[core] make parse_request,request.request same buf
4 years ago
Glenn Strauss
d7ad5819e6
[core] copy request only if might need for logging
...
copy request header only if we may need to log it upon error
4 years ago
Glenn Strauss
9ab5469365
[core] parse request in connection_read_header()
4 years ago
Glenn Strauss
8426b94161
[core] perf: optimize connection_read_header()
4 years ago
Glenn Strauss
21afabb8f8
[core] helper funcs for connection_state_machine()
...
carve connection_state_machine() into separate functions per state
4 years ago
Glenn Strauss
9e55fd72b5
[core] quickly clear request buffer for reuse
4 years ago
Glenn Strauss
fb9b8ad8ae
[core] mark startup/shutdown funcs cold
4 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)
4 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)
4 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()
4 years ago
Glenn Strauss
f13db69012
[core] fix setting of headers previously reset ( fixes #2919 )
...
bug may result in long delays when using mod_deflate on connections
with keep-alive, as the result is sent without Content-Length or
Transfer-Encoding
(regression in lighttpd 1.4.51)
(thx GilGalaad)
x-ref:
"high latency on 1.4.51 + proxy + deflate"
https://redmine.lighttpd.net/boards/2/topics/8365
https://redmine.lighttpd.net/issues/2919
4 years ago
Glenn Strauss
88ee73d0a2
[multiple] perf: simplify chunkqueue_get_memory()
4 years ago
Glenn Strauss
e7c840502a
[core] perf: copy small strings; better buf reuse
...
copy small strings to write queue for better buffer reuse
(instead of swapping with larger buffers in write chunkqueue)
4 years ago
Glenn Strauss
23c72fc606
[core] perf: prepend headers directly into write q
...
prepend response headers directly into write queue chunkqueue
4 years ago
Glenn Strauss
5a159e828d
[core] perf: size write buffers for reuse
...
size write buffers for reuse in common cases
(so that write buffers are BUFFER_MAX_REUSE_SIZE)
4 years ago
Glenn Strauss
062089ff14
[core] perf: array_reset_data_strings()
...
array_reset_data_strings() specialization
4 years ago
Glenn Strauss
29dd9379ff
[core] perf: call connection_reset() fewer times
...
connection_reset() is called at end of request to prepare for keep-alive
or to free resources while waiting for client to close connection.
This is the reason why it is called earlier towards end of request
rather than always waiting until the very end of request when socket
is closed.
connection_reset() used to additionally be called for every new socket
connection, but now is only called when new conns are allocated and
initialized.
4 years ago
Glenn Strauss
98f5cc6f0d
[core] permit server.error_handler to static file
...
This use is not recommended since it means that the response body
will not contain the precise error code.
x-ref:
"What is the proper syntax for server.error-handler in 1.4.45"
https://redmine.lighttpd.net/boards/2/topics/8320
4 years ago
Glenn Strauss
90c30d5e90
[core] http_status_append()
4 years ago
Glenn Strauss
9725299587
[core] code reuse with http_response_body_clear()
...
code reuse with http_response_body_clear()
rename con->response.transfer_encoding to con->response.send_chunked
4 years ago
Glenn Strauss
3dd3cde902
[core] abstraction layer for HTTP header manip
...
http_header.[ch]
convert existing calls to manip request/response headers
convert existing calls to manip environment array (often header-related)
4 years ago
Glenn Strauss
a7c27c9f99
[core] code reuse with array_insert_key_value()
...
code reuse with array_insert_key_value() and related array manipulation
4 years ago
Glenn Strauss
c4d743bb4d
mod_sockproxy - socket forwarding
...
(experimental)
4 years ago
Glenn Strauss
7c8cc6f7c5
[core] option to propagate TCP FIN to backend host
...
(experimental support for mod_sockproxy)
"tcp-fin-propagate" = "enable" for each host in *.server backend defs
4 years ago