diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-10-22 16:38:26 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-10-22 16:38:26 +0000 |
commit | dc9dd434aa1cfd24a98265742ff0ed4aeefc1f05 (patch) | |
tree | ceedf7b247bf2d5291da9c0cc2243fd3c3e505a9 /src/os/unix/ngx_readv_chain.c | |
parent | 5bf3d25d69ecdbccaa98beeb089a7a6850529b89 (diff) | |
download | nginx-dc9dd434aa1cfd24a98265742ff0ed4aeefc1f05.tar.gz nginx-dc9dd434aa1cfd24a98265742ff0ed4aeefc1f05.zip |
nginx-0.0.1-2003-10-22-20:38:26 import
Diffstat (limited to 'src/os/unix/ngx_readv_chain.c')
-rw-r--r-- | src/os/unix/ngx_readv_chain.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c index fe9a505c7..c83b076ce 100644 --- a/src/os/unix/ngx_readv_chain.c +++ b/src/os/unix/ngx_readv_chain.c @@ -4,7 +4,7 @@ #include <ngx_event.h> -ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *entry) +ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain) { ssize_t n; struct iovec *iov; @@ -19,19 +19,17 @@ ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *entry) /* TODO: coalesce the neighbouring chain entries */ - while (entry) { + while (chain) { ngx_test_null(iov, ngx_push_array(&io), NGX_ERROR); - iov->iov_base = entry->hunk->last; - iov->iov_len = entry->hunk->end - entry->hunk->last; - entry = entry->next; + iov->iov_base = chain->hunk->last; + iov->iov_len = chain->hunk->end - chain->hunk->last; + chain = chain->next; } ngx_log_debug(c->log, "recv: %d:%d" _ io.nelts _ iov->iov_len); n = readv(c->fd, (struct iovec *) io.elts, io.nelts); - ngx_destroy_array(&io); - if (n == -1) { c->read->ready = 0; |