diff options
author | Igor Sysoev <igor@sysoev.ru> | 2019-05-30 15:33:51 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2019-05-30 15:33:51 +0300 |
commit | 16273cf1c606a8dfc9934720b691f90312f9e2ab (patch) | |
tree | 61d8f221fd57ffe9d033432da279d595c2847562 /src/nxt_http_request.c | |
parent | 0ba7cfce7572070892bf54ed69b82a822e3ee0d4 (diff) | |
download | unit-16273cf1c606a8dfc9934720b691f90312f9e2ab.tar.gz unit-16273cf1c606a8dfc9934720b691f90312f9e2ab.tar.bz2 |
Handling routing errors.
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r-- | src/nxt_http_request.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c index 3ba7ffe7..1265c186 100644 --- a/src/nxt_http_request.c +++ b/src/nxt_http_request.c @@ -295,26 +295,23 @@ nxt_http_request_pass(nxt_task_t *task, void *obj, void *data) pass = r->conf->socket_conf->pass; - if (nxt_slow_path(pass == NULL)) { - goto fail; - } + if (nxt_fast_path(pass != NULL)) { - for ( ;; ) { - nxt_debug(task, "http request route: %V", &pass->name); + do { + nxt_debug(task, "http request route: %V", &pass->name); - pass = pass->handler(task, r, pass); - if (pass == NULL) { - break; - } + pass = pass->handler(task, r, pass); - if (nxt_slow_path(r->pass_count++ == 255)) { - goto fail; - } - } + if (pass == NULL) { + return; + } - return; + if (pass == NXT_HTTP_PASS_ERROR) { + break; + } -fail: + } while (r->pass_count++ < 255); + } nxt_http_request_error(task, r, NXT_HTTP_INTERNAL_SERVER_ERROR); } |