aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-02-19 16:48:14 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-02-19 16:48:14 +0000
commitbb1ba3fa6d8e12074afeea8c27e29699e29fb04e (patch)
treebe4c5d7b1784ad274ea1201e1caea12c9c855c8a /src
parent43c3cd91a9d810947f0d971129c06c05353a756a (diff)
downloadnginx-bb1ba3fa6d8e12074afeea8c27e29699e29fb04e.tar.gz
nginx-bb1ba3fa6d8e12074afeea8c27e29699e29fb04e.zip
nginx-0.0.2-2004-02-19-19:48:14 import
Diffstat (limited to 'src')
-rw-r--r--src/os/unix/ngx_freebsd_sendfile_chain.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c
index d5e1831bc..00236fa11 100644
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c
@@ -118,30 +118,33 @@ ngx_chain_t *ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in)
}
}
- /* create the tailer iovec and coalesce the neighbouring hunks */
+ if (file) {
+ /* create the tailer iovec and coalesce the neighbouring hunks */
- prev = NULL;
- iov = NULL;
+ prev = NULL;
+ iov = NULL;
- for ( /* void */; cl && trailer.nelts < IOV_MAX; cl = cl->next) {
- if (ngx_hunk_special(cl->hunk)) {
- continue;
- }
+ for ( /* void */; cl && trailer.nelts < IOV_MAX; cl = cl->next) {
+ if (ngx_hunk_special(cl->hunk)) {
+ continue;
+ }
- if (!ngx_hunk_in_memory_only(cl->hunk)) {
- break;
- }
+ if (!ngx_hunk_in_memory_only(cl->hunk)) {
+ break;
+ }
- if (prev == cl->hunk->pos) {
- iov->iov_len += cl->hunk->last - cl->hunk->pos;
+ if (prev == cl->hunk->pos) {
+ iov->iov_len += cl->hunk->last - cl->hunk->pos;
- } else {
- ngx_test_null(iov, ngx_push_array(&trailer), NGX_CHAIN_ERROR);
- iov->iov_base = cl->hunk->pos;
- iov->iov_len = cl->hunk->last - cl->hunk->pos;
- }
+ } else {
+ ngx_test_null(iov, ngx_push_array(&trailer),
+ NGX_CHAIN_ERROR);
+ iov->iov_base = cl->hunk->pos;
+ iov->iov_len = cl->hunk->last - cl->hunk->pos;
+ }
- prev = cl->hunk->last;
+ prev = cl->hunk->last;
+ }
}
/*