Klaus Demo nginx / 832571f
rename ngx_http_discard_body() to ngx_http_discard_request_body() Igor Sysoev 13 years ago
9 changed file(s) with 18 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
352352 return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
353353 }
354354
355 rc = ngx_http_discard_body(r);
355 rc = ngx_http_discard_request_body(r);
356356
357357 if (rc != NGX_OK && rc != NGX_AGAIN) {
358358 return rc;
468468 return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
469469 }
470470
471 rc = ngx_http_discard_body(r);
471 rc = ngx_http_discard_request_body(r);
472472
473473 if (rc != NGX_OK && rc != NGX_AGAIN) {
474474 return rc;
610610
611611 overwrite_done:
612612
613 rc = ngx_http_discard_body(r);
613 rc = ngx_http_discard_request_body(r);
614614
615615 if (rc != NGX_OK && rc != NGX_AGAIN) {
616616 return rc;
115115 return NGX_HTTP_NOT_ALLOWED;
116116 }
117117
118 rc = ngx_http_discard_body(r);
118 rc = ngx_http_discard_request_body(r);
119119
120120 if (rc != NGX_OK && rc != NGX_AGAIN) {
121121 return rc;
8888 return NGX_DECLINED;
8989 }
9090
91 rc = ngx_http_discard_body(r);
91 rc = ngx_http_discard_request_body(r);
9292
9393 if (rc != NGX_OK && rc != NGX_AGAIN) {
9494 return rc;
166166 return NGX_HTTP_NOT_ALLOWED;
167167 }
168168
169 rc = ngx_http_discard_body(r);
169 rc = ngx_http_discard_request_body(r);
170170
171171 if (rc != NGX_OK && rc != NGX_AGAIN) {
172172 return rc;
9999 return NGX_DECLINED;
100100 }
101101
102 rc = ngx_http_discard_body(r);
102 rc = ngx_http_discard_request_body(r);
103103
104104 if (rc != NGX_OK && rc != NGX_AGAIN) {
105105 return rc;
6868 return NGX_HTTP_NOT_ALLOWED;
6969 }
7070
71 rc = ngx_http_discard_body(r);
71 rc = ngx_http_discard_request_body(r);
7272
7373 if (rc != NGX_OK && rc != NGX_AGAIN) {
7474 return rc;
9797
9898
9999
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);
101101 void ngx_http_block_reading(ngx_http_request_t *r);
102102
103103
1313 static ngx_int_t ngx_http_do_read_client_request_body(ngx_http_request_t *r);
1414 static ngx_int_t ngx_http_write_request_body(ngx_http_request_t *r,
1515 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);
1818
1919
2020 /*
424424
425425
426426 ngx_int_t
427 ngx_http_discard_body(ngx_http_request_t *r)
427 ngx_http_discard_request_body(ngx_http_request_t *r)
428428 {
429429 ssize_t size;
430430 ngx_event_t *rev;
460460 }
461461 }
462462
463 r->read_event_handler = ngx_http_read_discarded_body_handler;
463 r->read_event_handler = ngx_http_read_discarded_request_body_handler;
464464
465465 if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
466466 return NGX_HTTP_INTERNAL_SERVER_ERROR;
467467 }
468468
469 return ngx_http_read_discarded_body(r);
469 return ngx_http_read_discarded_request_body(r);
470470 }
471471
472472
473473 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)
475475 {
476476 ngx_int_t rc;
477477
478 rc = ngx_http_read_discarded_body(r);
478 rc = ngx_http_read_discarded_request_body(r);
479479
480480 if (rc == NGX_AGAIN) {
481481 if (ngx_handle_read_event(r->connection->read, 0) == NGX_ERROR) {
491491
492492
493493 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)
495495 {
496496 size_t size;
497497 ssize_t n;
326326 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
327327 "http special response: %d, \"%V\"", error, &r->uri);
328328
329 rc = ngx_http_discard_body(r);
329 rc = ngx_http_discard_request_body(r);
330330
331331 if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) {
332332 error = NGX_HTTP_INTERNAL_SERVER_ERROR;