Mercurial > hg > nginx
comparison src/os/unix/ngx_recv_chain.c @ 75:869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 14 Apr 2003 17:04:58 +0000 |
parents | 17ab1af8c3dd |
children | a7e45c45a95c |
comparison
equal
deleted
inserted
replaced
74:17ab1af8c3dd | 75:869b10be682f |
---|---|
16 ngx_init_array(io, c->pool, 10, sizeof(struct iovec), NGX_ERROR); | 16 ngx_init_array(io, c->pool, 10, sizeof(struct iovec), NGX_ERROR); |
17 | 17 |
18 while (ce) { | 18 while (ce) { |
19 ngx_test_null(iov, ngx_push_array(&io), NGX_ERROR); | 19 ngx_test_null(iov, ngx_push_array(&io), NGX_ERROR); |
20 iov->iov_base = ce->hunk->pos; | 20 iov->iov_base = ce->hunk->pos; |
21 iov->iov_len = ce->hunk->last - ce->hunk->pos; | 21 iov->iov_len = ce->hunk->end - ce->hunk->last; |
22 ce = ce->next; | 22 ce = ce->next; |
23 } | 23 } |
24 | |
25 ngx_log_debug(c->log, "recv: %d:%d" _ io.nelts _ iov->iov_len); | |
24 | 26 |
25 n = readv(c->fd, (struct iovec *) io.elts, io.nelts); | 27 n = readv(c->fd, (struct iovec *) io.elts, io.nelts); |
26 | 28 |
27 ngx_destroy_array(&io); | 29 ngx_destroy_array(&io); |
28 | 30 |
29 if (n == -1) { | 31 if (n == -1) { |
30 c->read->ready = 0; | 32 c->read->ready = 0; |
31 | 33 |
34 err = ngx_errno; | |
32 if (err == NGX_EAGAIN) { | 35 if (err == NGX_EAGAIN) { |
33 ngx_log_error(NGX_LOG_INFO, c->log, err, "readv() returned EAGAIN"); | 36 ngx_log_error(NGX_LOG_INFO, c->log, err, "readv() returned EAGAIN"); |
34 return NGX_AGAIN; | 37 return NGX_AGAIN; |
35 } | 38 } |
36 | 39 |