diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2003-04-22 15:02:58 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2003-04-22 15:02:58 +0000 |
| commit | 8dcd23e83724a4547133a16560af9c365d59293c (patch) | |
| tree | f9902c472e44575d191391d3c42ff362e020d715 /src/event/ngx_event_proxy.c | |
| parent | b1ab5d0606817286e743f8060cfc61c6fd8b6f3e (diff) | |
| download | nginx-8dcd23e83724a4547133a16560af9c365d59293c.tar.gz nginx-8dcd23e83724a4547133a16560af9c365d59293c.tar.bz2 | |
nginx-0.0.1-2003-04-22-19:02:58 import
Diffstat (limited to 'src/event/ngx_event_proxy.c')
| -rw-r--r-- | src/event/ngx_event_proxy.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/event/ngx_event_proxy.c b/src/event/ngx_event_proxy.c index 334f8684d..47530f6e5 100644 --- a/src/event/ngx_event_proxy.c +++ b/src/event/ngx_event_proxy.c @@ -40,6 +40,27 @@ ngx_log_debug(p->log, "read upstream"); } else { +#if (HAVE_KQUEUE) /* kqueue notifies about the end of file or a pending error */ + + if (ngx_event_type == NGX_HAVE_KQUEUE_EVENT) { + + if (p->upstream->read->error) { + ngx_log_error(NGX_LOG_ERR, p->log, + p->upstream->read->error, + "readv() failed"); + p->upstream_error = 1; + + return NGX_ERROR; + + } else if (p->upstream->read->eof + && p->upstream->read->available == 0) { + p->upstream_eof = 1; + p->block_upstream = 0; + + break; + } + } +#endif /* use the free hunks if they exist */ if (p->free_hunks) { @@ -151,6 +172,7 @@ ngx_log_debug(p->log, "recv_chain: %d" _ n); } p->upstream_eof = 1; p->block_upstream = 0; + break; } @@ -399,7 +421,8 @@ int ngx_event_proxy_write_to_downstream(ngx_event_proxy_t *p) ngx_hunk_t *h; ngx_chain_t *entry; - if (p->downstream_level == 0 + if (p->upstream_level == 0 + && p->downstream_level == 0 && p->busy_hunk == NULL && p->out_hunks == NULL && p->in_hunks == NULL |
