Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
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>
|
|
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.
|
|
|
|
This commit adds the variables $arg_NAME, $header_NAME, and $cookie_NAME.
|
|
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/
|
|
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.
|
|
That parameter is not being modified in the function. Make it
'const' to allow passing 'static const' variables.
|
|
|
|
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"
},
}
}
}
}
|
|
|
|
This patch closes #328 in github.
|
|
|
|
It allows to add an array element without specifying the index.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Requested by Igor.
|
|
Requested by Igor.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|