summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_upstream.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-04-25Constify a bunch of static local variablesAndrew Clayton1-1/+1
A common pattern was to declare variables in functions like static nxt_str_t ... Not sure why static, as they were being treated more like string literals (and of course they are _not_ thread safe), let's actually make them constants (qualifier wise). This handles core code conversion. Reviewed-by: Zhidao HONG <z.hong@f5.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2021-09-07Router: refactored variable pass.Zhidao HONG1-2/+7
Since the "pass" option supports both strings and variables, a generic nxt_var_t structure can be used in the configuration phase, and the "name" field in actions is redundant. No functional changes.
2021-08-02Router: fixed segmentation fault.Zhidao HONG1-0/+4
In the case that routes or upstreams is empty and the pass option is a variable. If the resolved pass is routes or upstreams, a segment error occurred.
2020-08-28Router: fixed "pass" to upstreams.hongzhidao1-2/+2
Messed up return values in nxt_upstream_find() caused error in applying any configuration with a valid "pass" value in router configuration pointing to upstream. That wasn't the case in "listeners" objects, where the return value wasn't checked. Also, it caused segfault in cases where the "pass" option was configured with variables and resulting value was pointing to a non-existent upstream. Added missing return checks as well to catch possible memory allocation errors. The bug was introduced in d32bc428f46b. This closes #472 issue on GitHub.
2020-08-13Basic variables support.Valentin Bartenev1-2/+4
2020-03-06Round robin upstream added.Igor Sysoev1-1/+134
2020-03-04Legacy upstream code removed.Igor Sysoev1-36/+0
2017-01-17Initial version.Igor Sysoev1-0/+43