summaryrefslogtreecommitdiff
path: root/src/http_range.c
Commit message (Collapse)AuthorAgeFilesLines
* [multiple] spelling: github action check-spellingGlenn Strauss2023-01-091-1/+1
|
* [multiple] codespell: correct spelling in commentsGlenn Strauss2023-01-071-1/+1
|
* [multiple] use buffer_append_char()Glenn Strauss2022-05-111-2/+2
|
* [core] feature flag to allow Range w/ HTTP/1.0Glenn Strauss2022-02-051-0/+9
| | | | | | | | | | | | | | | | | server.feature-flags += ( "http10.range" => "enable" ) The Range request header is HTTP/1.1, not HTTP/1.0. Intermediate HTTP/1.0 proxies might mishandle or incorrectly cache responses to HTTP/1.1 Range requests, so the default in lighttpd is to ignore Range requests sent with HTTP/1.0. This feature flag changes the default if an admin desires to support dumb HTTP/1.0 clients that might (incorrectly) send Range requests with HTTP/1.0. Those client really ought to grow HTTP/1.1 support: add support to receive HTTP/1.1 Transfer-Encoding: chunked responses, and then those client may safely send HTTP/1.1 Range requests (and in many cases, also Connection: close).
* [core] replace strncasecmp w/ buffer_eq_icase_ssnGlenn Strauss2021-08-271-5/+5
| | | | | replace strncasecmp() w/ buffer_clen() and buffer_eq_icase_ssn() (portability; remove use of alt sys-strings.h portability header)
* [multiple] reduce redundant NULL buffer checksGlenn Strauss2021-08-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [multiple] use buffer_append_* aggregatesGlenn Strauss2021-04-021-2/+2
| | | | reduces the number of round-trips into some frequently-called routines
* [multiple] http_header APIs to reduce str copiesGlenn Strauss2021-03-261-6/+4
|
* [core] quiet coverity warningGlenn Strauss2021-03-021-0/+6
|
* [core] http_range.[ch] RFC 7233 Range handlingGlenn Strauss2021-03-021-0/+453
(import from one of my development branches from 2015)