summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conf.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-03-28Remove NXT_CONF_MAP_INT8.Andrew Clayton1-1/+0
This has been replaced by NXT_CONF_MAP_BOOL. Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2023-03-28Add NXT_CONF_MAP_BOOL.Andrew Clayton1-0/+1
When adding a boolean config option, this is of type NXT_CONF_VALUE_BOOLEAN, however when mapping such an entry to a structure member via nxt_conf_map_object() this is done as a NXT_CONF_MAP_INT8. It took a bit of head scratching to find out that it should have been a NXT_CONF_MAP_INT8 and not a NXT_CONF_MAP_INT. Introduce a new map type of NXT_CONF_MAP_BOOL that will eventually replace NXT_CONF_MAP_INT8 for representing booleans... We use the short form _BOOL as that matches the naming convention of the other types in nxt_conf_map_type_t. This is part of a set of patches and eventually NXT_CONF_MAP_BOOL will simply replace NXT_CONF_MAP_INT8. Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2023-03-28Convert uint8_t struct boolean members to nxt_bool_t.Andrew Clayton1-1/+1
Replace the usage of uint8_t in structures to represent boolean values with our nxt_bool_t type. This will result in no change in structure layout as the nxt_bool_t is now a uint8_t, same as what it's replacing. Even though it's essentially the same type, it makes it much clearer as to what its purpose is. This was largely done with the following script from Alex, with some manual conversions $ grep -rl 'uint8_t.*1 bit' src/ \ | xargs sed -i '/uint8_t.*1 bit/{s/uint8_t /nxt_bool_t /;s/; *\/\*.*/;/}' This doesn't convert the non-uint8_t booleans, they will be handled separately. Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2022-11-20Var: separating nxt_tstr_t from nxt_var_t.Zhidao HONG1-1/+1
It's for the introduction of njs support. For each option that supports native variable and JS template literals introduced next, it's unified as template string. No functional changes.
2022-08-29Implemented basic statistics API.Valentin Bartenev1-0/+2
2022-07-14Var: dynamic variables support.Zhidao HONG1-0/+1
This commit adds the variables $arg_NAME, $header_NAME, and $cookie_NAME.
2022-06-22Constified numerous function parameters.Andrew Clayton1-3/+3
As was pointed out by the cppcheck[0] static code analysis utility we can mark numerous function parameters as 'const'. This acts as a hint to the compiler about our intentions and the compiler will tell us when we deviate from them. [0]: https://cppcheck.sourceforge.io/
2022-04-26Added new array APIs that also work with non-arrays.Alejandro Colomar1-0/+4
Similar to how C pointers to variables can always be considered as pointers to the first element of an array of size 1 (see the following code for an example of how they are equivalent), treating non-NXT_CONF_VALUE_ARRAY as if they were NXT_CONF_VALUE_ARRAYs of size 1 allows for simpler and more generic code. void foo(ptrdiff_t sz, int arr[sz]) { for (ptrdiff_t i = 0; i < sz; i++) arr[i] = 0; } void bar(void) { int x; int y[1]; foo(1, &x); foo(1, y); } nxt_conf_array_elements_count_or_1(): Similar to nxt_conf_array_elements_count(). Return a size of 1 when input is non-array, instead of causing undefined behavior. That value (1) makes sense because it will be used as the limiter of a loop that loops over the array and calls nxt_conf_get_array_element_or_itself(), which will return a correct element for such loops. nxt_conf_get_array_element_or_itself(): Similar to nxt_conf_get_array_element(). Return the input pointer unmodified (i.e., a pointer to the unique element of a hypothetical array), instead of returning NULL, which wasn't very useful. nxt_conf_array_qsort(): Since it's a no-op for non-arrays, this API can be reused.
2022-04-26Added 'const' for read-only function parameter.Alejandro Colomar1-1/+1
That parameter is not being modified in the function. Make it 'const' to allow passing 'static const' variables.
2021-10-09Configuration: automatic migration to the new "share" behavior.Zhidao HONG1-0/+2
2020-05-14PHP: implemented "targets" option.Valentin Bartenev1-1/+1
This allows to specify multiple subsequent targets inside PHP applications. For example: { "listeners": { "*:80": { "pass": "routes" } }, "routes": [ { "match": { "uri": "/info" }, "action": { "pass": "applications/my_app/phpinfo" } }, { "match": { "uri": "/hello" }, "action": { "pass": "applications/my_app/hello" } }, { "action": { "pass": "applications/my_app/rest" } } ], "applications": { "my_app": { "type": "php", "targets": { "phpinfo": { "script": "phpinfo.php", "root": "/www/data/admin", }, "hello": { "script": "hello.php", "root": "/www/data/test", }, "rest": { "root": "/www/data/example.com", "index": "index.php" }, } } } }
2020-03-30Configuration: support for rational numbers.Valentin Bartenev1-1/+1
2019-10-11Fixed passing false in namespace flags.Tiago Natel1-0/+1
This patch closes #328 in github.
2019-09-19Basic support for serving static files.Valentin Bartenev1-0/+1
2019-04-24Configuration: support for POST operations on arrays.Valentin Bartenev1-2/+11
It allows to add an array element without specifying the index.
2019-02-28Introducing Java Servlet Container beta.Max Romanov1-1/+1
2019-02-26Introduced nxt_conf_array_qsort().Igor Sysoev1-0/+2
2019-02-26Introduced nxt_conf_array_elements_count().Igor Sysoev1-0/+1
2018-09-20Controller: certificates storage interface.Valentin Bartenev1-0/+12
2018-09-20Deduplicated string value initializations.Valentin Bartenev1-0/+1
2018-06-07Exported functions for accessing configuration values.Valentin Bartenev1-9/+10
2018-01-29Introducing extended app process management.Max Romanov1-0/+1
- Pre-fork 'processes.spare' application processes; - fork more processes to keep 'processes.spare' idle processes; - fork on-demand up to 'processes.max' count; - scale down idle application processes above 'processes.spare' after 'processes.idle_timeout'; - number of concurrently started application processes also limited by 'processes.spare' (or 1, if spare is 0).
2017-10-10Basic validation errors.Valentin Bartenev1-8/+17
2017-08-16Introduced nxt_conf_get_array_element().Valentin Bartenev1-0/+2
2017-08-16Object mapping interface extended with more string types.Valentin Bartenev1-2/+4
2017-08-11Controller: more HTTP headers and detailed JSON parsing errors.Valentin Bartenev1-3/+16
2017-07-18Configuration: reduced memory consumption of long strings.Valentin Bartenev1-2/+2
2017-07-10Configuration: nxt_conf_map_object() improvements.Valentin Bartenev1-1/+1
2017-07-06Controller: sending JSON configuration to router.Valentin Bartenev1-0/+8
2017-07-05Configuration: basic validation of schema.Valentin Bartenev1-0/+13
2017-06-29Added nxt_msec_t element to nxt_conf_map_object().Igor Sysoev1-0/+1
2017-06-28Configuration: reduced names of structures, functions, and macros.Valentin Bartenev1-36/+33
2017-06-28JSON property iterator nxt_conf_json_object_next_member().Igor Sysoev1-0/+2
2017-06-26Interface for mapping JSON configuration objects to C structures.Valentin Bartenev1-2/+25
2017-06-23Configuration printing functions splitted in two parts.Valentin Bartenev1-1/+3
Requested by Igor.
2017-06-23Renames and reordering of parameters in configuration parser functions.Valentin Bartenev1-10/+13
Requested by Igor.
2017-06-20Using new memory pool implementation.Igor Sysoev1-3/+3
2017-05-30Controller: support for partial PUT and DELETE operations.Valentin Bartenev1-1/+10
2017-05-26Style and a trivial fix.Valentin Bartenev1-1/+1
2017-05-23Optimized internal representation of JSON objects and arrays.Valentin Bartenev1-0/+2
2017-05-18Controller: partial retrieving of configuration.Valentin Bartenev1-0/+2
2017-05-16Controller: pretty-printing of JSON responses.Valentin Bartenev1-2/+8
2017-05-15Controller: trivial abilities to save and request configuration.Valentin Bartenev1-1/+1
Now you can get current configuration with: $ curl 127.0.0.1:8443 and put new configuration with: $ curl -X PUT -d @conf.json 127.0.0.1:8443
2017-04-11JSON output in controller.Valentin Bartenev1-0/+2
2017-04-10JSON parsing in controller.Valentin Bartenev1-0/+19