diff options
author | Igor Sysoev <igor@sysoev.ru> | 2002-09-07 10:14:25 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2002-09-07 10:14:25 +0000 |
commit | 96f8377fd89b8735027ccfebea8ad9e77f40f51c (patch) | |
tree | 14e7de7a0e7c7d9815184a1e9bb95edab0617990 /src/os/unix/ngx_sendv.c | |
parent | a58e3ca14300fce97b2124233afe140c8d59199f (diff) | |
download | nginx-96f8377fd89b8735027ccfebea8ad9e77f40f51c.tar.gz nginx-96f8377fd89b8735027ccfebea8ad9e77f40f51c.zip |
nginx-0.0.1-2002-09-07-14:14:25 import
Diffstat (limited to 'src/os/unix/ngx_sendv.c')
-rw-r--r-- | src/os/unix/ngx_sendv.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/os/unix/ngx_sendv.c b/src/os/unix/ngx_sendv.c index dec16a1bc..409456890 100644 --- a/src/os/unix/ngx_sendv.c +++ b/src/os/unix/ngx_sendv.c @@ -1,18 +1,28 @@ #include <ngx_core.h> #include <ngx_types.h> -#include <ngx_socket.h> +#include <ngx_errno.h> +#include <ngx_connection.h> +#include <ngx_log.h> #include <ngx_sendv.h> -ssize_t ngx_sendv(ngx_socket_t s, ngx_iovec_t *iovec, int n, size_t *sent) +ssize_t ngx_sendv(ngx_connection_t *c, ngx_iovec_t *iovec, int n) { ssize_t rc; + ngx_err_t err; - rc = writev(s, iovec, n); + rc = writev(c->fd, iovec, n); - if (rc == -1) + if (rc == -1) { + err = ngx_socket_errno; + if (err == NGX_EAGAIN) { + ngx_log_error(NGX_LOG_INFO, c->log, err, "sendv() eagain"); + return NGX_AGAIN; + } + + ngx_log_error(NGX_LOG_ERR, c->log, err, "sendv() failed"); return NGX_ERROR; + } - *sent = rc; - return NGX_OK; + return rc; } |