Handling routing errors.
This commit is contained in:
@@ -295,27 +295,24 @@ 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)) {
|
||||
|
||||
do {
|
||||
nxt_debug(task, "http request route: %V", &pass->name);
|
||||
|
||||
pass = pass->handler(task, r, pass);
|
||||
|
||||
if (pass == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pass == NXT_HTTP_PASS_ERROR) {
|
||||
break;
|
||||
}
|
||||
|
||||
} while (r->pass_count++ < 255);
|
||||
}
|
||||
|
||||
for ( ;; ) {
|
||||
nxt_debug(task, "http request route: %V", &pass->name);
|
||||
|
||||
pass = pass->handler(task, r, pass);
|
||||
if (pass == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (nxt_slow_path(r->pass_count++ == 255)) {
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
fail:
|
||||
|
||||
nxt_http_request_error(task, r, NXT_HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user