aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-04-28 06:14:50 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-04-28 06:14:50 +0000
commit4cec79fb6a3138aeeee400b9c32f23a22cf2dac8 (patch)
tree71ef80d2e71fdc81e756862eed80ae2c42288f53 /src/os/unix
parenta30a028f14b18d7c12892d2fe79f457b4a67dd29 (diff)
downloadnginx-4cec79fb6a3138aeeee400b9c32f23a22cf2dac8.tar.gz
nginx-4cec79fb6a3138aeeee400b9c32f23a22cf2dac8.zip
nginx-0.0.3-2004-04-28-10:14:50 import
Diffstat (limited to 'src/os/unix')
-rw-r--r--src/os/unix/ngx_readv_chain.c15
-rw-r--r--src/os/unix/ngx_recv.c16
2 files changed, 19 insertions, 12 deletions
diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c
index 49bb3ef3e..86f774a0d 100644
--- a/src/os/unix/ngx_readv_chain.c
+++ b/src/os/unix/ngx_readv_chain.c
@@ -173,13 +173,16 @@ ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
do {
n = readv(c->fd, (struct iovec *) io.elts, io.nelts);
- if (n >= 0) {
- if (n < size) {
- rev->ready = 0;
- }
+ if (n == 0) {
+ rev->ready = 0;
+ rev->eof = 1;
- if (n == 0) {
- rev->eof = 1;
+ return n;
+
+ } else if (n > 0) {
+
+ if (n < size && !(ngx_event_flags & NGX_HAVE_GREEDY_EVENT)) {
+ rev->ready = 0;
}
return n;
diff --git a/src/os/unix/ngx_recv.c b/src/os/unix/ngx_recv.c
index 63453503c..04b594f6e 100644
--- a/src/os/unix/ngx_recv.c
+++ b/src/os/unix/ngx_recv.c
@@ -126,13 +126,17 @@ ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
"recv: fd:%d %d of %d", c->fd, n, size);
- if (n >= 0) {
- if ((size_t) n < size) {
- rev->ready = 0;
- }
+ if (n == 0) {
+ rev->ready = 0;
+ rev->eof = 1;
+ return n;
- if (n == 0) {
- rev->eof = 1;
+ } else if (n > 0) {
+
+ if ((size_t) n < size
+ && !(ngx_event_flags & NGX_HAVE_GREEDY_EVENT))
+ {
+ rev->ready = 0;
}
return n;