Commit Graph

7 Commits

Author SHA1 Message Date
Zhidao HONG
a336928e10 Router: refactored variable pass.
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-09-07 21:13:44 +08:00
Zhidao HONG
d16cf04167 Router: fixed segmentation fault.
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.
2021-08-02 12:30:38 +08:00
hongzhidao
806135f1c9 Router: fixed "pass" to upstreams.
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-28 00:53:36 -04:00
Valentin Bartenev
93146616cf Basic variables support. 2020-08-13 02:46:54 +03:00
Igor Sysoev
7935ea4543 Round robin upstream added. 2020-03-06 18:28:54 +03:00
Igor Sysoev
794248090a Legacy upstream code removed. 2020-03-04 14:04:08 +03:00
Igor Sysoev
16cbf3c076 Initial version. 2017-01-17 20:00:00 +03:00