summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_route.c
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2021-07-24 11:44:52 +0800
committerZhidao HONG <z.hong@f5.com>2021-07-24 11:44:52 +0800
commitf3a1c1deb541784b2b0ed179514e4d5eba9fe626 (patch)
tree7e21c103d575db815b89404530ee0447b00f1a4e /src/nxt_http_route.c
parentb47f1ac7ea3d80981485fd4ae82cd1c7fca3c337 (diff)
downloadunit-f3a1c1deb541784b2b0ed179514e4d5eba9fe626.tar.gz
unit-f3a1c1deb541784b2b0ed179514e4d5eba9fe626.tar.bz2
Router: split nxt_http_app_conf_t from nxt_http_action_t.
No functional changes.
Diffstat (limited to 'src/nxt_http_route.c')
-rw-r--r--src/nxt_http_route.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c
index bed127c9..c38acdf3 100644
--- a/src/nxt_http_route.c
+++ b/src/nxt_http_route.c
@@ -1482,9 +1482,7 @@ static nxt_int_t
nxt_http_pass_find(nxt_task_t *task, nxt_mp_t *mp, nxt_router_conf_t *rtcf,
nxt_http_action_t *action)
{
- nxt_str_t *targets;
nxt_int_t ret;
- nxt_uint_t i;
nxt_str_t segments[3];
ret = nxt_http_pass_segments(mp, &action->name, segments, 3);
@@ -1493,24 +1491,8 @@ nxt_http_pass_find(nxt_task_t *task, nxt_mp_t *mp, nxt_router_conf_t *rtcf,
}
if (nxt_str_eq(&segments[0], "applications", 12)) {
- ret = nxt_router_listener_application(rtcf, &segments[1], action);
-
- if (ret != NXT_OK) {
- return ret;
- }
-
- if (segments[2].length != 0) {
- targets = action->u.app.application->targets;
-
- for (i = 0; !nxt_strstr_eq(&segments[2], &targets[i]); i++);
-
- action->u.app.target = i;
-
- } else {
- action->u.app.target = 0;
- }
-
- return NXT_OK;
+ return nxt_router_application_init(rtcf, &segments[1], &segments[2],
+ action);
}
if (segments[2].length == 0) {
@@ -1643,9 +1625,7 @@ nxt_http_pass_application(nxt_task_t *task, nxt_router_conf_t *rtcf,
action->name = *name;
- (void) nxt_router_listener_application(rtcf, name, action);
-
- action->u.app.target = 0;
+ (void) nxt_router_application_init(rtcf, name, NULL, action);
return action;
}