Mercurial > hg > nginx-quic
comparison src/http/ngx_http_request_body.c @ 3181:36f6407817dc
clear r->lingering_close to disable preventively calling
ngx_http_set_lingering_close() while request cleanup
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 02 Oct 2009 11:32:56 +0000 |
parents | 74b74513ed59 |
children | e67d000b5337 |
comparison
equal
deleted
inserted
replaced
3180:0e420f3f8e18 | 3181:36f6407817dc |
---|---|
473 | 473 |
474 if (ngx_handle_read_event(rev, 0) != NGX_OK) { | 474 if (ngx_handle_read_event(rev, 0) != NGX_OK) { |
475 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 475 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
476 } | 476 } |
477 | 477 |
478 if (ngx_http_read_discarded_request_body(r) != NGX_OK) { | 478 if (ngx_http_read_discarded_request_body(r) == NGX_OK) { |
479 r->lingering_close = 0; | |
480 | |
481 } else { | |
479 r->count++; | 482 r->count++; |
480 r->discard_body = 1; | 483 r->discard_body = 1; |
481 } | 484 } |
482 | 485 |
483 return NGX_OK; | 486 return NGX_OK; |
506 if (r->lingering_time) { | 509 if (r->lingering_time) { |
507 timer = (ngx_msec_t) (r->lingering_time - ngx_time()); | 510 timer = (ngx_msec_t) (r->lingering_time - ngx_time()); |
508 | 511 |
509 if (timer <= 0) { | 512 if (timer <= 0) { |
510 r->discard_body = 0; | 513 r->discard_body = 0; |
514 r->lingering_close = 0; | |
511 ngx_http_finalize_request(r, 0); | 515 ngx_http_finalize_request(r, 0); |
512 return; | 516 return; |
513 } | 517 } |
514 | 518 |
515 } else { | 519 } else { |
519 rc = ngx_http_read_discarded_request_body(r); | 523 rc = ngx_http_read_discarded_request_body(r); |
520 | 524 |
521 if (rc == NGX_OK) { | 525 if (rc == NGX_OK) { |
522 | 526 |
523 r->discard_body = 0; | 527 r->discard_body = 0; |
528 r->lingering_close = 0; | |
524 | 529 |
525 if (r->done) { | 530 if (r->done) { |
526 ngx_http_finalize_request(r, 0); | 531 ngx_http_finalize_request(r, 0); |
527 } | 532 } |
528 | 533 |