Mercurial > hg > nginx
changeset 402:f209f3391020
nginx-0.0.9-2004-07-28-20:16:50 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 28 Jul 2004 16:16:50 +0000 |
parents | b32ca005e025 |
children | ea3113b181d1 |
files | src/core/ngx_output_chain.c src/event/modules/ngx_rtsig_module.c src/http/ngx_http_write_filter.c src/os/unix/ngx_freebsd_sendfile_chain.c src/os/unix/ngx_linux_sendfile_chain.c |
diffstat | 5 files changed, 24 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_output_chain.c Mon Jul 26 18:31:43 2004 +0000 +++ b/src/core/ngx_output_chain.c Wed Jul 28 16:16:50 2004 +0000 @@ -73,6 +73,13 @@ continue; } + bsize = ngx_buf_size(ctx->in->buf); + + if (bsize == 0) { + ctx->in = ctx->in->next; + continue; + } + if (ctx->buf == NULL) { /* get the free buf */ @@ -91,8 +98,6 @@ if (ctx->in->buf->last_buf) { - bsize = ngx_buf_size(ctx->in->buf); - if (bsize < ctx->bufs.size) { /*
--- a/src/event/modules/ngx_rtsig_module.c Mon Jul 26 18:31:43 2004 +0000 +++ b/src/event/modules/ngx_rtsig_module.c Wed Jul 28 16:16:50 2004 +0000 @@ -626,20 +626,20 @@ cycle->log, 0, "poll() failed while the overflow recover"); - if (err != NGX_EINTR) { - break; + if (err == NGX_EINTR) { + continue; } } + + break; } if (ready <= 0) { continue; } - if (n) { - if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_ERROR) { - return NGX_ERROR; - } + if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_ERROR) { + return NGX_ERROR; } for (i = 0; i < n; i++) { @@ -686,9 +686,7 @@ } } - if (n) { - ngx_mutex_unlock(ngx_posted_events_mutex); - } + ngx_mutex_unlock(ngx_posted_events_mutex); if (tested >= rtscf->overflow_test) { @@ -723,7 +721,7 @@ } /* - * drain rt signal queue if the /proc/sys/kernel/rtsig-nr + * drain the rt signal queue if the /proc/sys/kernel/rtsig-nr * is bigger than * /proc/sys/kernel/rtsig-max / rtsig_overflow_threshold */ @@ -741,7 +739,7 @@ /* * Linux has not KERN_RTSIGMAX since 2.6.6-mm2 - * so drain rt signal queue unconditionally + * so drain the rt signal queue unconditionally */ while (ngx_rtsig_process_events(cycle) == NGX_OK) { /* void */ }
--- a/src/http/ngx_http_write_filter.c Mon Jul 26 18:31:43 2004 +0000 +++ b/src/http/ngx_http_write_filter.c Wed Jul 28 16:16:50 2004 +0000 @@ -40,7 +40,7 @@ ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) { int last; - off_t size, flush, sent; + off_t size, flush, sent, bsize; ngx_chain_t *cl, *ln, **ll, *chain; ngx_connection_t *c; ngx_http_core_loc_conf_t *clcf; @@ -82,7 +82,13 @@ *ll = cl; ll = &cl->next; - size += ngx_buf_size(cl->buf); + bsize = ngx_buf_size(cl->buf); + + if (bsize == 0 && cl->buf->in_file) { + cl->buf->in_file = 0; + } + + size += bsize; if (cl->buf->flush || cl->buf->recycled) { flush = size;
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c Mon Jul 26 18:31:43 2004 +0000 +++ b/src/os/unix/ngx_freebsd_sendfile_chain.c Wed Jul 28 16:16:50 2004 +0000 @@ -120,7 +120,6 @@ if (cl && cl->buf->in_file && send < limit) { file = cl->buf; - fsize = 0; /* coalesce the neighbouring file bufs */
--- a/src/os/unix/ngx_linux_sendfile_chain.c Mon Jul 26 18:31:43 2004 +0000 +++ b/src/os/unix/ngx_linux_sendfile_chain.c Wed Jul 28 16:16:50 2004 +0000 @@ -127,7 +127,6 @@ if (header.nelts == 0 && cl && cl->buf->in_file && send < limit) { file = cl->buf; - fsize = 0; /* coalesce the neighbouring file bufs */