Klaus Demo nginx / 78aacc8
Upstream: request finalization rework. No semantic changes expected, though some checks are done differently. In particular, the r->cached flag is no longer explicitly checked. Instead, we relay on u->header_sent not being set if a response is sent from a cache. Maxim Dounin 8 years ago
1 changed file(s) with 20 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
34023402
34033403 #endif
34043404
3405 if (u->header_sent
3406 && rc != NGX_HTTP_REQUEST_TIME_OUT
3407 && rc != NGX_HTTP_CLIENT_CLOSED_REQUEST
3408 && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE))
3405 if (rc == NGX_DECLINED) {
3406 return;
3407 }
3408
3409 r->connection->log->action = "sending to client";
3410
3411 if (!u->header_sent
3412 || rc == NGX_HTTP_REQUEST_TIME_OUT
3413 || rc == NGX_HTTP_CLIENT_CLOSED_REQUEST)
34093414 {
3415 ngx_http_finalize_request(r, rc);
3416 return;
3417 }
3418
3419 if (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE) {
34103420 rc = 0;
34113421 }
34123422
3413 if (rc == NGX_DECLINED) {
3414 return;
3415 }
3416
3417 r->connection->log->action = "sending to client";
3418
3419 if (rc == 0
3420 && !r->header_only
3421 #if (NGX_HTTP_CACHE)
3422 && !r->cached
3423 #endif
3424 )
3425 {
3423 if (r->header_only) {
3424 ngx_http_finalize_request(r, rc);
3425 return;
3426 }
3427
3428 if (rc == 0) {
34263429 rc = ngx_http_send_special(r, NGX_HTTP_LAST);
34273430 }
34283431