diff options
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index d7e4d69f1..c80df6e66 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -959,7 +959,7 @@ ngx_http_process_request_line(ngx_event_t *rev) n = ngx_http_read_request_header(r); if (n == NGX_AGAIN || n == NGX_ERROR) { - return; + break; } } @@ -984,7 +984,7 @@ ngx_http_process_request_line(ngx_event_t *rev) } if (ngx_http_process_request_uri(r) != NGX_OK) { - return; + break; } if (r->schema_end) { @@ -1003,16 +1003,16 @@ ngx_http_process_request_line(ngx_event_t *rev) ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent invalid host in request line"); ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); - return; + break; } if (rc == NGX_ERROR) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; + break; } if (ngx_http_set_virtual_server(r, &host) == NGX_ERROR) { - return; + break; } r->headers_in.server = host; @@ -1024,11 +1024,11 @@ ngx_http_process_request_line(ngx_event_t *rev) && ngx_http_set_virtual_server(r, &r->headers_in.server) == NGX_ERROR) { - return; + break; } ngx_http_process_request(r); - return; + break; } @@ -1037,7 +1037,7 @@ ngx_http_process_request_line(ngx_event_t *rev) != NGX_OK) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; + break; } c->log->action = "reading client request headers"; @@ -1045,7 +1045,7 @@ ngx_http_process_request_line(ngx_event_t *rev) rev->handler = ngx_http_process_request_headers; ngx_http_process_request_headers(rev); - return; + break; } if (rc != NGX_AGAIN) { @@ -1062,7 +1062,7 @@ ngx_http_process_request_line(ngx_event_t *rev) ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); } - return; + break; } /* NGX_AGAIN: a request line parsing is still incomplete */ @@ -1073,7 +1073,7 @@ ngx_http_process_request_line(ngx_event_t *rev) if (rv == NGX_ERROR) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; + break; } if (rv == NGX_DECLINED) { @@ -1083,10 +1083,12 @@ ngx_http_process_request_line(ngx_event_t *rev) ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent too long URI"); ngx_http_finalize_request(r, NGX_HTTP_REQUEST_URI_TOO_LARGE); - return; + break; } } } + + ngx_http_run_posted_requests(c); } @@ -1248,7 +1250,7 @@ ngx_http_process_request_headers(ngx_event_t *rev) if (rv == NGX_ERROR) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; + break; } if (rv == NGX_DECLINED) { @@ -1261,7 +1263,7 @@ ngx_http_process_request_headers(ngx_event_t *rev) "client sent too large request"); ngx_http_finalize_request(r, NGX_HTTP_REQUEST_HEADER_TOO_LARGE); - return; + break; } len = r->header_in->end - p; @@ -1276,14 +1278,14 @@ ngx_http_process_request_headers(ngx_event_t *rev) ngx_http_finalize_request(r, NGX_HTTP_REQUEST_HEADER_TOO_LARGE); - return; + break; } } n = ngx_http_read_request_header(r); if (n == NGX_AGAIN || n == NGX_ERROR) { - return; + break; } } @@ -1313,7 +1315,7 @@ ngx_http_process_request_headers(ngx_event_t *rev) h = ngx_list_push(&r->headers_in.headers); if (h == NULL) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; + break; } h->hash = r->header_hash; @@ -1329,7 +1331,7 @@ ngx_http_process_request_headers(ngx_event_t *rev) h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); if (h->lowcase_key == NULL) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; + break; } if (h->key.len == r->lowcase_index) { @@ -1343,7 +1345,7 @@ ngx_http_process_request_headers(ngx_event_t *rev) h->lowcase_key, h->key.len); if (hh && hh->handler(r, h, hh->offset) != NGX_OK) { - return; + break; } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, @@ -1367,12 +1369,12 @@ ngx_http_process_request_headers(ngx_event_t *rev) rc = ngx_http_process_request_header(r); if (rc != NGX_OK) { - return; + break; } ngx_http_process_request(r); - return; + break; } if (rc == NGX_AGAIN) { @@ -1388,8 +1390,10 @@ ngx_http_process_request_headers(ngx_event_t *rev) "client sent invalid header line"); ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); - return; + break; } + + ngx_http_run_posted_requests(c); } @@ -1944,8 +1948,6 @@ ngx_http_process_request(ngx_http_request_t *r) r->read_event_handler = ngx_http_block_reading; ngx_http_handler(r); - - ngx_http_run_posted_requests(c); } |