comparison src/os/unix/ngx_readv_chain.c @ 4:4b2dafa26fe2 NGINX_0_1_2

nginx 0.1.2 *) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; bug appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; bug appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
author Igor Sysoev <http://sysoev.ru>
date Thu, 21 Oct 2004 00:00:00 +0400
parents f0b350454894
children 6f8b0dc0f8dd
comparison
equal deleted inserted replaced
3:8beaf7b3241f 4:4b2dafa26fe2
20 ngx_event_t *rev; 20 ngx_event_t *rev;
21 struct iovec *iov; 21 struct iovec *iov;
22 22
23 rev = c->read; 23 rev = c->read;
24 24
25 if (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT) { 25 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
26 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, 26 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
27 "readv: eof:%d, avail:%d, err:%d", 27 "readv: eof:%d, avail:%d, err:%d",
28 rev->pending_eof, rev->available, rev->kq_errno); 28 rev->pending_eof, rev->available, rev->kq_errno);
29 29
30 if (rev->available == 0) { 30 if (rev->available == 0) {
79 79
80 do { 80 do {
81 n = readv(c->fd, (struct iovec *) io.elts, io.nelts); 81 n = readv(c->fd, (struct iovec *) io.elts, io.nelts);
82 82
83 if (n >= 0) { 83 if (n >= 0) {
84 if (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT) { 84 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
85 rev->available -= n; 85 rev->available -= n;
86 86
87 /* 87 /*
88 * rev->available can be negative here because some additional 88 * rev->available can be negative here because some additional
89 * bytes can be received between kevent() and recv() 89 * bytes can be received between kevent() and recv()
184 184
185 return n; 185 return n;
186 186
187 } else if (n > 0) { 187 } else if (n > 0) {
188 188
189 if (n < size && !(ngx_event_flags & NGX_HAVE_GREEDY_EVENT)) { 189 if (n < size && !(ngx_event_flags & NGX_USE_GREEDY_EVENT)) {
190 rev->ready = 0; 190 rev->ready = 0;
191 } 191 }
192 192
193 return n; 193 return n;
194 } 194 }