# HG changeset patch # User Igor Sysoev # Date 1077209294 0 # Node ID cd009bf7400d2b6a120023d1903a1749601a123e # Parent 43c26e85205a03a6f636c41bc3bfc32fd7cb0f15 nginx-0.0.2-2004-02-19-19:48:14 import diff --git a/auto/modules b/auto/modules --- a/auto/modules +++ b/auto/modules @@ -54,7 +54,7 @@ HTTP_FILTER_MODULES="$HTTP_FILTER_MODULE HTTP_MODULES="$HTTP_MODULES $HTTP_STATIC_MODULE $HTTP_INDEX_MODULE" -if [ $HTTP_REWRITE = YES ]; then +if [ $HTTP_REWRITE = YES -a $USE_PCRE != DISABLED ]; then USE_PCRE=YES HTTP_MODULES="$HTTP_MODULES $HTTP_REWRITE_MODULE" HTTP_SRCS="$HTTP_SRCS $HTTP_REWRITE_SRCS" diff --git a/auto/options b/auto/options --- a/auto/options +++ b/auto/options @@ -58,7 +58,7 @@ do --with-cc=*) CC="$value" ;; - --without-pcre) USE_PCRE=NO ;; + --without-pcre) USE_PCRE=DISABLED ;; --with-pcre=*) PCRE="$value" ;; --with-md5=*) MD5="$value" ;; --with-zlib=*) ZLIB="$value" ;; diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c --- 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( } } - /* create the tailer iovec and coalesce the neighbouring hunks */ - - prev = NULL; - iov = NULL; + if (file) { + /* create the tailer iovec and coalesce the neighbouring hunks */ - for ( /* void */; cl && trailer.nelts < IOV_MAX; cl = cl->next) { - if (ngx_hunk_special(cl->hunk)) { - continue; - } + prev = NULL; + iov = NULL; + + 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; } /*