b->file_last = of.size;
b->in_file = b->file_last ? 1: 0;
- b->last_buf = 1;
+ b->last_buf = (r == r->main) ? 1 : 0;
b->last_in_chain = 1;
b->file->fd = of.fd;
b->file_last = of.size;
b->in_file = b->file_last ? 1 : 0;
- b->last_buf = 1;
+ b->last_buf = (r == r->main) ? 1 : 0;
b->last_in_chain = 1;
b->file->fd = of.fd;
b->file_last = of.size;
b->in_file = b->file_last ? 1 : 0;
- b->last_buf = 1;
+ b->last_buf = (r == r->main) ? 1 : 0;
b->last_in_chain = 1;
b->file->fd = of.fd;
r->headers_out.status = NGX_HTTP_OK;
r->headers_out.content_length_n = b->last - b->pos;
- b->last_buf = 1;
+ b->last_buf = (r == r->main) ? 1 : 0;
rc = ngx_http_send_header(r);