rename ngx_http_discard_body() to ngx_http_discard_request_body()
Igor Sysoev
13 years ago
352 | 352 | return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE; |
353 | 353 | } |
354 | 354 | |
355 | rc = ngx_http_discard_body(r); | |
355 | rc = ngx_http_discard_request_body(r); | |
356 | 356 | |
357 | 357 | if (rc != NGX_OK && rc != NGX_AGAIN) { |
358 | 358 | return rc; |
468 | 468 | return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE; |
469 | 469 | } |
470 | 470 | |
471 | rc = ngx_http_discard_body(r); | |
471 | rc = ngx_http_discard_request_body(r); | |
472 | 472 | |
473 | 473 | if (rc != NGX_OK && rc != NGX_AGAIN) { |
474 | 474 | return rc; |
610 | 610 | |
611 | 611 | overwrite_done: |
612 | 612 | |
613 | rc = ngx_http_discard_body(r); | |
613 | rc = ngx_http_discard_request_body(r); | |
614 | 614 | |
615 | 615 | if (rc != NGX_OK && rc != NGX_AGAIN) { |
616 | 616 | return rc; |
115 | 115 | return NGX_HTTP_NOT_ALLOWED; |
116 | 116 | } |
117 | 117 | |
118 | rc = ngx_http_discard_body(r); | |
118 | rc = ngx_http_discard_request_body(r); | |
119 | 119 | |
120 | 120 | if (rc != NGX_OK && rc != NGX_AGAIN) { |
121 | 121 | return rc; |
88 | 88 | return NGX_DECLINED; |
89 | 89 | } |
90 | 90 | |
91 | rc = ngx_http_discard_body(r); | |
91 | rc = ngx_http_discard_request_body(r); | |
92 | 92 | |
93 | 93 | if (rc != NGX_OK && rc != NGX_AGAIN) { |
94 | 94 | return rc; |
166 | 166 | return NGX_HTTP_NOT_ALLOWED; |
167 | 167 | } |
168 | 168 | |
169 | rc = ngx_http_discard_body(r); | |
169 | rc = ngx_http_discard_request_body(r); | |
170 | 170 | |
171 | 171 | if (rc != NGX_OK && rc != NGX_AGAIN) { |
172 | 172 | return rc; |
99 | 99 | return NGX_DECLINED; |
100 | 100 | } |
101 | 101 | |
102 | rc = ngx_http_discard_body(r); | |
102 | rc = ngx_http_discard_request_body(r); | |
103 | 103 | |
104 | 104 | if (rc != NGX_OK && rc != NGX_AGAIN) { |
105 | 105 | return rc; |
68 | 68 | return NGX_HTTP_NOT_ALLOWED; |
69 | 69 | } |
70 | 70 | |
71 | rc = ngx_http_discard_body(r); | |
71 | rc = ngx_http_discard_request_body(r); | |
72 | 72 | |
73 | 73 | if (rc != NGX_OK && rc != NGX_AGAIN) { |
74 | 74 | return rc; |
97 | 97 | |
98 | 98 | |
99 | 99 | |
100 | ngx_int_t ngx_http_discard_body(ngx_http_request_t *r); | |
100 | ngx_int_t ngx_http_discard_request_body(ngx_http_request_t *r); | |
101 | 101 | void ngx_http_block_reading(ngx_http_request_t *r); |
102 | 102 | |
103 | 103 |
13 | 13 | static ngx_int_t ngx_http_do_read_client_request_body(ngx_http_request_t *r); |
14 | 14 | static ngx_int_t ngx_http_write_request_body(ngx_http_request_t *r, |
15 | 15 | ngx_chain_t *body); |
16 | static void ngx_http_read_discarded_body_handler(ngx_http_request_t *r); | |
17 | static ngx_int_t ngx_http_read_discarded_body(ngx_http_request_t *r); | |
16 | static void ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r); | |
17 | static ngx_int_t ngx_http_read_discarded_request_body(ngx_http_request_t *r); | |
18 | 18 | |
19 | 19 | |
20 | 20 | /* |
424 | 424 | |
425 | 425 | |
426 | 426 | ngx_int_t |
427 | ngx_http_discard_body(ngx_http_request_t *r) | |
427 | ngx_http_discard_request_body(ngx_http_request_t *r) | |
428 | 428 | { |
429 | 429 | ssize_t size; |
430 | 430 | ngx_event_t *rev; |
460 | 460 | } |
461 | 461 | } |
462 | 462 | |
463 | r->read_event_handler = ngx_http_read_discarded_body_handler; | |
463 | r->read_event_handler = ngx_http_read_discarded_request_body_handler; | |
464 | 464 | |
465 | 465 | if (ngx_handle_read_event(rev, 0) == NGX_ERROR) { |
466 | 466 | return NGX_HTTP_INTERNAL_SERVER_ERROR; |
467 | 467 | } |
468 | 468 | |
469 | return ngx_http_read_discarded_body(r); | |
469 | return ngx_http_read_discarded_request_body(r); | |
470 | 470 | } |
471 | 471 | |
472 | 472 | |
473 | 473 | static void |
474 | ngx_http_read_discarded_body_handler(ngx_http_request_t *r) | |
474 | ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r) | |
475 | 475 | { |
476 | 476 | ngx_int_t rc; |
477 | 477 | |
478 | rc = ngx_http_read_discarded_body(r); | |
478 | rc = ngx_http_read_discarded_request_body(r); | |
479 | 479 | |
480 | 480 | if (rc == NGX_AGAIN) { |
481 | 481 | if (ngx_handle_read_event(r->connection->read, 0) == NGX_ERROR) { |
491 | 491 | |
492 | 492 | |
493 | 493 | static ngx_int_t |
494 | ngx_http_read_discarded_body(ngx_http_request_t *r) | |
494 | ngx_http_read_discarded_request_body(ngx_http_request_t *r) | |
495 | 495 | { |
496 | 496 | size_t size; |
497 | 497 | ssize_t n; |
326 | 326 | ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
327 | 327 | "http special response: %d, \"%V\"", error, &r->uri); |
328 | 328 | |
329 | rc = ngx_http_discard_body(r); | |
329 | rc = ngx_http_discard_request_body(r); | |
330 | 330 | |
331 | 331 | if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) { |
332 | 332 | error = NGX_HTTP_INTERNAL_SERVER_ERROR; |