Commit Graph

3074 Commits (e2de4e581ec7a61fd9f5218f260d3890837e31a4)
 

Author SHA1 Message Date
Glenn Strauss e2de4e581e [core] const char *name in struct plugin
put void *data (always used) as first member of struct plugin

add int nconfig member to PLUGIN_DATA

calloc() inits p->data to NULL
3 years ago
Glenn Strauss 2c43ae73dd [mod_redirect,mod_rewrite] store context_ndx
store config context_ndx instead of data_config *dc
3 years ago
Glenn Strauss 36f64b26a1 [core] simpler config_check_cond()
optimize for common case where condition has been evaluated for
the request and a cached result exists

(also: begin isolating data_config)
3 years ago
Glenn Strauss b6e0880ae6 [mod_accesslog] avoid alloc for parsing cookie val 3 years ago
Glenn Strauss feb21b3da2 [core] inline header and env arrays into con 3 years ago
Glenn Strauss e3dc34d142 [core] array a->sorted[] as ptrs rather than pos
While slightly more memory use in 64-bit (though same memory use as
prior versions of lighttpd), avoids bouncing through second array
when searching in sorted list.  Most use of arrays in lighttpd is to
build a list once, and elements are not removed from the list.
3 years ago
Glenn Strauss a762402da5 [core] keep a->data[] sorted (REVERT)
This reverts commit 2260a8062ee599ecf28d9b52b981603fd2084aff.

original ordering of array elements is significant
e.g. in lighttpd.conf lists where first match to request is applied
3 years ago
Glenn Strauss 78cf61b152 [core] streamline config_check_cond()
avoid passing srv; use con->srv when needed
3 years ago
Glenn Strauss 5aadcba456 [core] buffer string in data_config
(instead of (buffer *))
3 years ago
Glenn Strauss a51278030e [core] const char *op in data_config
(instead of (buffer *))
3 years ago
Glenn Strauss c2238256e2 [core] inline array as part of data_array value
(instead of value being (array *))
3 years ago
Glenn Strauss 6eb34ef5ab [core] add const to callers of http_header_*_get()
(The few places where value is modified in-place were not made const)
3 years ago
Glenn Strauss 601c572c39 [core] inline buffer as part of data_string value
(instead of value being (buffer *))
3 years ago
Glenn Strauss b7942c58cc [core] (data_unset *) from array_get_element_klen
return (data_unset *) from array_get_element_klen() to prep for
putting buffer into data_string for value member, rather than as
(buffer *)

(allow in-place modification of these buffer values)
3 years ago
Glenn Strauss 47a758f959 [core] inline buffer key for *_patch_connection()
handle buffer key as part of DATA_UNSET in *_patch_connection()
(instead of key being (buffer *))
3 years ago
Glenn Strauss ad9b7e009b [core] inline buffer as part of DATA_UNSET key
(instead of key being (buffer *))
3 years ago
Glenn Strauss cff64cf170 [core] http_header_hkey_get() over const array
fixed-size power-2 struct keylenvalue
http_headers_off[] of offsets into http_headers[] by string length
3 years ago
Glenn Strauss a7a721ab43 [core] treat con->conditional_is_valid as bitfield 3 years ago
Glenn Strauss 0c64096555 [core] isolate data_config.c, vector.c
isolate data_config.c, vector.c to lighttpd executable, not modules
3 years ago
Glenn Strauss e01f995ce3 [core] run config_setup_connection() fewer times
config_setup_connection() is run when con struct is init'd and in
connection_reset(), after each request is processed.  It also must be
called upon HANDLER_COMEBACK when the request needs to be re-parsed,
but it need not be run twice in common scenario without HANDLER_COMEBACK
3 years ago
Glenn Strauss 78a6440492 [core] perf: initialize con->conf using memcpy()
initialize specific_config (con->conf) from top-level specific_config
using memcpy()
3 years ago
Glenn Strauss 0ce30f8c22 [core] (const buffer *) for con->server_name
use con->server_name_buf when modules set server_name (e.g from db)
3 years ago
Glenn Strauss 5d13b40824 [core] (const buffer *) in (struct burl_parts_t) 3 years ago
Glenn Strauss 83535bbef3 [core] differentiate array_get_* for ro and rw
array_get_element_klen() is now intended for read-only access
array_get_data_unset() is used by config processing for r/w access
array_get_buf_ptr() is used for r/w access to ds->value (string buffer)
3 years ago
Glenn Strauss 5c0c4936b4 [core] __attribute_returns_nonnull__ 3 years ago
Glenn Strauss c9f1b612f1 [core] keep a->data[] sorted; remove a->sorted[] 3 years ago
Glenn Strauss 61785d868f [core] array keys are non-empty in key-value list 3 years ago
Glenn Strauss db5ff222e4 [core] short-circuit path to clear request.headers
short-circuit path to clear con->request.headers if entire size of
all request headers is <= BUFFER_MAX_REUSE_SIZE

clear (reset) data_string key and value upon reuse
3 years ago
Glenn Strauss 5d9bfc9a76 [core] remove unused members of struct server 3 years ago
Glenn Strauss 10d71279ae [core] uint32_t for struct buffer sizes 3 years ago
Glenn Strauss 62e97967ca [core] prefer uint32_t to size_t in base.h
even 2 billion is way larger than even extreme operating values
expected for the members in base.h

include some structs directly in struct server, rather than by ptr
3 years ago
Glenn Strauss ddb78f75ee [core] remove unused array_reset() 3 years ago
Glenn Strauss 785037dded [core] http_header.c internal inline funcs 3 years ago
Glenn Strauss 70b5d729ae [core] mark some data_* funcs cold
mark funcs cold if seldom used or used only at startup config processing

mark most data_config_* funcs cold

data_*_copy()
data_*_insert_dup()
data_*_print()
data_*_reset()

array_reset()
3 years ago
Glenn Strauss b2991c686d [core] perf: array.c performance enhancements
mark array_get_index() as hot, rewrite to be pure and return sorted pos

mark routines as pure, as appropriate

mark routines as cold if used only at startup for config processing

mark params const, as appropriate

array_get_buf_ptr() for modifiable value buffer after insert into array

uint32_t used and size members instead of size_t

remove a->unique_ndx member; simply add to end of array for value lists
remove du->is_index_key member; simply check buffer_is_empty(du->key)

array_insert_key_value() used to be a hint that lookup could be skipped,
but the state from array_get_index() is now saved and reused internally,
so the distinction is no longer needed.  Use array_set_key_value().
3 years ago
Glenn Strauss 2fd0faf1bf [mod_extforward] simplify code: use light_isxdigit 3 years ago
Glenn Strauss d58787189a [core] handle common case of alnum or - field-name
handle common case of alnum or - field-name before calling
http_request_parse_header_other()
3 years ago
Glenn Strauss 71a7b54947 [core] more 'const' in request.c prototypes 3 years ago
Glenn Strauss 36f3206a4c [core] pass ptr to http_request_parse() 3 years ago
Glenn Strauss 8223903e50 [core] inline connection_read_header()
inline connection_read_header() into connection_handle_read_state()

(The large stack usage prevents the compiler from inlining the routine,
 but if we enter connection_handle_read_state(), then we are going to
 be running connection_read_header(), so put them together)
3 years ago
Glenn Strauss 11f3dd896b [core] perf: connection_read_header_hoff() hot 3 years ago
Glenn Strauss ec2ff2c6ae [core] perf: connection_read_header_more()
additional header parsing optimization
collect request headers into single buffer for parsing
3 years ago
Glenn Strauss 46d7e9c2ed [core] no need to pass srv to connection_set_state 3 years ago
Glenn Strauss 63e32e8100 [core] perf: HTTP header parsing using \n offsets 3 years ago
Glenn Strauss fa4ab19275 [core] reduce use of struct parse_header_state 3 years ago
Glenn Strauss cdf653f8ce [core] pass con around request, not srv and con
In the cold cases where srv is needed, obtain from con->srv
3 years ago
Glenn Strauss fcd1f57511 [core] connection_chunkqueue_compact() 3 years ago
Glenn Strauss 2ad92d17a1 [core] chunkqueue_compact_mem() 3 years ago
Glenn Strauss d22e7a769d [core] cold buffer_string_prepare_append_resize() 3 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
3 years ago