From dcfa92c161296af903fc1ebd4ddb98d1c38c59e7 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 21 Aug 2020 20:50:04 +0300 Subject: Configuration: removed "reschedule_timeout" option. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not used since cbcd76704c90. This option is a leftover from previous IPC between router and applications processes. It was never documented, though. Thanks to 洪志道 (Hong Zhi Dao). --- src/nxt_router.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/nxt_router.c') diff --git a/src/nxt_router.c b/src/nxt_router.c index 0e1de6fa..c08bf7d7 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -24,7 +24,6 @@ typedef struct { uint32_t max_processes; uint32_t spare_processes; nxt_msec_t timeout; - nxt_msec_t res_timeout; nxt_msec_t idle_timeout; uint32_t requests; nxt_conf_value_t *limits_value; @@ -1157,12 +1156,6 @@ static nxt_conf_map_t nxt_router_app_limits_conf[] = { offsetof(nxt_router_app_conf_t, timeout), }, - { - nxt_string("reschedule_timeout"), - NXT_CONF_MAP_MSEC, - offsetof(nxt_router_app_conf_t, res_timeout), - }, - { nxt_string("requests"), NXT_CONF_MAP_INT32, @@ -1423,7 +1416,6 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, apcf.max_processes = 1; apcf.spare_processes = 0; apcf.timeout = 0; - apcf.res_timeout = 1000; apcf.idle_timeout = 15000; apcf.requests = 0; apcf.limits_value = NULL; @@ -1505,8 +1497,6 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, nxt_debug(task, "application type: %V", &apcf.type); nxt_debug(task, "application processes: %D", apcf.processes); nxt_debug(task, "application request timeout: %M", apcf.timeout); - nxt_debug(task, "application reschedule timeout: %M", - apcf.res_timeout); nxt_debug(task, "application requests: %D", apcf.requests); lang = nxt_app_lang_module(task->thread->runtime, &apcf.type); @@ -1537,7 +1527,6 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, app->max_pending_processes = apcf.spare_processes ? apcf.spare_processes : 1; app->timeout = apcf.timeout; - app->res_timeout = apcf.res_timeout * 1000000; app->idle_timeout = apcf.idle_timeout; app->max_requests = apcf.requests; -- cgit From d5973fb557c6eca95da671f80637955b5eca00d3 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Tue, 15 Sep 2020 20:12:25 +0300 Subject: Python: changed request headers format in router protocol. The coming ASGI support requires raw HTTP headers format. Headers grouping and upcase code were moved to WSGI module. --- src/nxt_router.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nxt_router.c') diff --git a/src/nxt_router.c b/src/nxt_router.c index c08bf7d7..ea14c6fb 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -259,7 +259,7 @@ static const nxt_str_t empty_prefix = nxt_string(""); static const nxt_str_t *nxt_app_msg_prefix[] = { &empty_prefix, - &http_prefix, + &empty_prefix, &http_prefix, &http_prefix, &http_prefix, -- cgit From 806135f1c93c09bb513efc1341d084951b080278 Mon Sep 17 00:00:00 2001 From: hongzhidao Date: Fri, 28 Aug 2020 00:53:36 -0400 Subject: 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. --- src/nxt_router.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nxt_router.c') diff --git a/src/nxt_router.c b/src/nxt_router.c index ea14c6fb..b7408c3c 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -1725,6 +1725,10 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, tmcf->router_conf, &lscf.application); } + + if (nxt_slow_path(skcf->action == NULL)) { + goto fail; + } } } -- cgit From c721a5378dd467054f672a40e677be56bad53c4d Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Tue, 29 Sep 2020 22:57:56 +0300 Subject: Fixing request buffer memory leakage in router. The issue was introduced in changeset 1d84b9e4b459. The request buffer was transferred via the shared application queue, but the buffer position and the 'sent' flag were not updated after the buffer had been sent. --- src/nxt_router.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nxt_router.c') diff --git a/src/nxt_router.c b/src/nxt_router.c index b7408c3c..a3218047 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -4941,6 +4941,9 @@ nxt_router_app_prepare_request(nxt_task_t *task, nxt_debug(task, "queue is not empty"); } + buf->is_port_mmap_sent = 1; + buf->mem.pos = buf->mem.free; + } else { nxt_alert(task, "stream #%uD, app '%V': failed to send app message", req_rpc_data->stream, &app->name); -- cgit