aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_linux_sendfile_chain.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-12-16 15:07:08 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-12-16 15:07:08 +0000
commit2402502c2f35b831ee89369a532b1ff4e4e19947 (patch)
tree37fb834956f497f8b2d2862c6c3514e1a25bfb37 /src/os/unix/ngx_linux_sendfile_chain.c
parent74297c285ef173784cac505fd406267ac7c8d3c7 (diff)
downloadnginx-2402502c2f35b831ee89369a532b1ff4e4e19947.tar.gz
nginx-2402502c2f35b831ee89369a532b1ff4e4e19947.zip
nginx-0.3.16-RELEASE importrelease-0.3.16
*) Feature: the ngx_http_map_module. *) Feature: the "types_hash_max_size" and "types_hash_bucket_size" directives. *) Feature: the "ssi_value_length" directive. *) Feature: the "worker_rlimit_core" directive. *) Workaround: the connection number in logs was always 1 if nginx was built by the icc 8.1 or 9.0 compilers with optimization for Pentium 4. *) Bugfix: the "config timefmt" SSI command set incorrect time format. *) Bugfix: nginx did not close connection to IMAP/POP3 backend for the SSL connections; the bug had appeared in 0.3.13. Thanks to Rob Mueller. *) Bugfix: segmentation fault may occurred in at SSL shutdown; the bug had appeared in 0.3.13.
Diffstat (limited to 'src/os/unix/ngx_linux_sendfile_chain.c')
-rw-r--r--src/os/unix/ngx_linux_sendfile_chain.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/os/unix/ngx_linux_sendfile_chain.c b/src/os/unix/ngx_linux_sendfile_chain.c
index f3830a8b3..225f9e1ec 100644
--- a/src/os/unix/ngx_linux_sendfile_chain.c
+++ b/src/os/unix/ngx_linux_sendfile_chain.c
@@ -26,21 +26,21 @@
ngx_chain_t *
ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
{
- int rc, tcp_nodelay;
- u_char *prev;
- off_t size, send, prev_send, aligned, sent, fprev;
- size_t file_size;
- ngx_uint_t eintr, complete;
- ngx_err_t err;
- ngx_buf_t *file;
- ngx_array_t header;
- ngx_event_t *wev;
- ngx_chain_t *cl;
- struct iovec *iov, headers[NGX_HEADERS];
+ int rc, tcp_nodelay;
+ off_t size, send, prev_send, aligned, sent, fprev;
+ u_char *prev;
+ size_t file_size;
+ ngx_err_t err;
+ ngx_buf_t *file;
+ ngx_uint_t eintr, complete;
+ ngx_array_t header;
+ ngx_event_t *wev;
+ ngx_chain_t *cl;
+ struct iovec *iov, headers[NGX_HEADERS];
#if (NGX_HAVE_SENDFILE64)
- off_t offset;
+ off_t offset;
#else
- int32_t offset;
+ int32_t offset;
#endif
wev = c->write;
@@ -233,6 +233,12 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
}
if (file) {
+#if 1
+ if (file_size == 0) {
+ ngx_debug_point();
+ return NGX_CHAIN_ERROR;
+ }
+#endif
#if (NGX_HAVE_SENDFILE64)
offset = file->file_pos;
#else