History log of /lighttpd1.4/src/mod_setenv.c (Results 1 – 25 of 41)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: lighttpd-1.4.69, lighttpd-1.4.68
# 5e14db43 10-Dec-2022 Glenn Strauss <[email protected]>

[multiple] employ ck_calloc, ck_malloc shared code

employ ck_calloc(), ck_malloc() shared code to slightly reduce code size
(centralize the ck_assert() to check that memory allocation succeeded)


# b82d7b8a 06-Dec-2022 Glenn Strauss <[email protected]>

[multiple] mark mod_*_plugin_init() funcs cold


Revision tags: lighttpd-1.4.67, lighttpd-1.4.66, lighttpd-1.4.65
# 083f42b9 23-Apr-2022 Glenn Strauss <[email protected]>

[mod_setenv] cleanup user-provided hdr sloppiness

cleanup user-provided request and response headers
- remove leading and trailing whitespace from value
- replace with ' ' line ends following ',' in

[mod_setenv] cleanup user-provided hdr sloppiness

cleanup user-provided request and response headers
- remove leading and trailing whitespace from value
- replace with ' ' line ends following ',' in value
- warn if header value contains '\r' or '\n'

show more ...


Revision tags: lighttpd-1.4.64, lighttpd-1.4.63, lighttpd-1.4.62, lighttpd-1.4.61, lighttpd-1.4.60
# 67c0b149 02-Aug-2021 Glenn Strauss <[email protected]>

[multiple] remove base.h include where not used

(substitute request.h if file only accesses request_st,
and not connection or server structs)


# af3df29a 09-Jun-2021 Glenn Strauss <[email protected]>

[multiple] reduce redundant NULL buffer checks

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 co

[multiple] reduce redundant NULL buffer checks

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

show more ...


Revision tags: lighttpd-1.4.59, lighttpd-1.4.58, lighttpd-1.4.57, lighttpd-1.4.56, lighttpd-1.4.56-rc7, lighttpd-1.4.56-rc6, lighttpd-1.4.56-rc5, lighttpd-1.4.56-rc4, lighttpd-1.4.56-rc3, lighttpd-1.4.56-rc2, lighttpd-1.4.56-rc1
# 2e0676fd 11-Sep-2020 Glenn Strauss <[email protected]>

[core] extend (data_string *) to store header id

(optional addition to (data_string *), used by http_header.[ch])

extend (data_string *) instead of creating another data_* TYPE_*
(new data type w

[core] extend (data_string *) to store header id

(optional addition to (data_string *), used by http_header.[ch])

extend (data_string *) instead of creating another data_* TYPE_*
(new data type would probably have (data_string *) as base class)
(might revisit choice in the future)

HTTP_HEADER_UNSPECIFIED has been removed. It was used in select
locations as an optimization to avoid looking up enum header_header_e
before checking the array, but the ordering in the array now relies
on having the id. Having the id allows for a quick check if a common
header is present or not in the htags bitmask, before checking the
array, and allows for integer comparison in the log(n) search of the
array, instead of strncasecmp().

With HTTP_HEADER_UNSPECIFIED removed, add optimization to set bit
in htags for HTTP_HEADER_OTHER when an "other" header is added,
but do not clear the bit, as there might be addtl "other" headers

show more ...


# 33c8cf41 25-Jul-2020 Glenn Strauss <[email protected]>

[multiple] rename connection_reset hook to request

rename connection_reset to handle_request_reset


Revision tags: lighttpd-1.4.55
# 7c7f8c46 13-Jan-2020 Glenn Strauss <[email protected]>

[multiple] split con, request (very large change)

NB: r->tmp_buf == srv->tmp_buf (pointer is copied for quicker access)

NB: request read and write chunkqueues currently point to connection
chun

[multiple] split con, request (very large change)

NB: r->tmp_buf == srv->tmp_buf (pointer is copied for quicker access)

NB: request read and write chunkqueues currently point to connection
chunkqueues; per-request and per-connection chunkqueues are
not distinct from one another
con->read_queue == r->read_queue
con->write_queue == r->write_queue

NB: in the future, a separate connection config may be needed for
connection-level module hooks. Similarly, might need to have
per-request chunkqueues separate from per-connection chunkqueues.
Should probably also have a request_reset() which is distinct from
connection_reset().

show more ...


# 100dfaa3 09-Jan-2020 Glenn Strauss <[email protected]>

[core] move plugin_ctx into (request_st *)

NB: in the future, a separate plugin_ctx may be needed for
connection-level plugins to keep state across multiple requests


# 03b4c993 08-Dec-2019 Glenn Strauss <[email protected]>

[multiple] generic config array type checking


# 50bdb55d 26-Nov-2019 Glenn Strauss <[email protected]>

[multiple] connection hooks no longer get (srv *)

(explicit (server *) not passed; available in con->srv)


# b73949e0 19-Nov-2019 Glenn Strauss <[email protected]>

[multiple] plugin.c handles common FREE_FUNC code

(simpler for modules; less boilerplate to cut-n-paste)


# 3fabcc36 25-Oct-2019 Glenn Strauss <[email protected]>

[mod_setenv] use config_plugin_values_init()


# e2de4e58 19-Oct-2019 Glenn Strauss <[email protected]>

[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


# 36f64b26 17-Oct-2019 Glenn Strauss <[email protected]>

[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)


# 601c572c 13-Oct-2019 Glenn Strauss <[email protected]>

[core] inline buffer as part of data_string value

(instead of value being (buffer *))


# 47a758f9 13-Oct-2019 Glenn Strauss <[email protected]>

[core] inline buffer key for *_patch_connection()

handle buffer key as part of DATA_UNSET in *_patch_connection()
(instead of key being (buffer *))


# ad9b7e00 13-Oct-2019 Glenn Strauss <[email protected]>

[core] inline buffer as part of DATA_UNSET key

(instead of key being (buffer *))


Revision tags: lighttpd-1.4.54
# 6a988bb0 27-Feb-2019 Mohammed Sadiq <[email protected]>

[multiple] cleaner calloc use in SETDEFAULTS_FUNC

github: closes #99

x-ref:
"cleaner calloc use in SETDEFAULTS_FUNC"
https://github.com/lighttpd/lighttpd1.4/pull/99


Revision tags: lighttpd-1.4.53, lighttpd-1.4.52
# f13db690 15-Nov-2018 Glenn Strauss <[email protected]>

[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
Tran

[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

show more ...


Revision tags: lighttpd-1.4.51
# 3dd3cde9 09-Sep-2018 Glenn Strauss <[email protected]>

[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)


# a7c27c9f 08-Sep-2018 Glenn Strauss <[email protected]>

[core] code reuse with array_insert_key_value()

code reuse with array_insert_key_value() and related array manipulation


Revision tags: lighttpd-1.4.50, lighttpd-1.4.49, lighttpd-1.4.48, lighttpd-1.4.47, lighttpd-1.4.46
# bd77abe0 05-Mar-2017 Glenn Strauss <[email protected]>

[config] more specific checks for array lists

More specific checks on contents of array lists. Each module using
lists now does better checking on the types of values in the list
(strings, integers

[config] more specific checks for array lists

More specific checks on contents of array lists. Each module using
lists now does better checking on the types of values in the list
(strings, integers, arrays/lists)

This helps prevent misconfiguration of things like cgi.assign,
fastcgi.server, and scgi.server, where source code might be
served as static files if parenthesis are misplaced.

x-ref:
https://redmine.lighttpd.net/boards/2/topics/6571

show more ...


Revision tags: lighttpd-1.4.45, lighttpd-1.4.44
# 4d92366a 22-Dec-2016 Glenn Strauss <[email protected]>

[mod_setenv] directives to overwrite/remove hdrs (fixes #650, fixes #2295)

directives to set value, rather than append values to headers, env
setenv.set-request-header
setenv.set-response-header

[mod_setenv] directives to overwrite/remove hdrs (fixes #650, fixes #2295)

directives to set value, rather than append values to headers, env
setenv.set-request-header
setenv.set-response-header
setenv.set-environment
These directives take precedence over the setenv.add-* counterparts

Set a blank value for request or response header to remove the header
(blank value in environment will be set as the value; not removed)

setenv.*-environment is now deferred to handle_request_env hook.
setenv.*-response-header is now processed in handle_response_start hook.

x-ref:
"setenv.add-or-replace-response-header"
https://redmine.lighttpd.net/issues/650
"set-request-header or remove-request-header support for mod_setenv"
https://redmine.lighttpd.net/issues/2295

show more ...


Revision tags: lighttpd-1.4.43, lighttpd-1.4.42, lighttpd-1.4.41, lighttpd-1.4.40
# 8abd06a7 19-Mar-2016 Glenn Strauss <[email protected]>

consistent inclusion of config.h at top of files (fixes #2073)

From: Glenn Strauss <[email protected]>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3113 152afb58-edef-03

consistent inclusion of config.h at top of files (fixes #2073)

From: Glenn Strauss <[email protected]>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3113 152afb58-edef-0310-8abb-c4023f1b3aa9

show more ...


12