summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c27
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);
}