diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-11-27 19:01:37 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-11-27 19:01:37 +0000 |
commit | 764543e73426fd00741483ff830cf09bfb73752f (patch) | |
tree | 27b8bad85c18469e593d30ee137fdb5fe1a16af4 /src/os/unix/ngx_solaris_sendfilev_chain.c | |
parent | 0e499db3ed63432cfacd08282cce1d42b568b567 (diff) | |
download | nginx-764543e73426fd00741483ff830cf09bfb73752f.tar.gz nginx-764543e73426fd00741483ff830cf09bfb73752f.zip |
nginx-0.0.1-2003-11-27-22:01:37 import
Diffstat (limited to 'src/os/unix/ngx_solaris_sendfilev_chain.c')
-rw-r--r-- | src/os/unix/ngx_solaris_sendfilev_chain.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/os/unix/ngx_solaris_sendfilev_chain.c b/src/os/unix/ngx_solaris_sendfilev_chain.c index 8fe5cef1e..c7d69feaf 100644 --- a/src/os/unix/ngx_solaris_sendfilev_chain.c +++ b/src/os/unix/ngx_solaris_sendfilev_chain.c @@ -9,9 +9,10 @@ ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in) int fd; char *prev; off_t fprev; - size_t sent; + size_t sent, size; ssize_t n; ngx_int_t eintr; + ngx_err_t err; sendfilevec_t *sfv; ngx_array_t vec; ngx_event_t *wev; @@ -26,10 +27,14 @@ ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in) do { fd = SFV_FD_SELF; prev = NULL; + fprev = 0; sfv = NULL; eintr = 0; sent = 0; + ngx_init_array(vec, c->pool, 10, sizeof(sendfilevec_t), + NGX_CHAIN_ERROR); + /* create the sendfilevec and coalesce the neighbouring hunks */ for (cl = in; cl; cl = cl->next) { @@ -47,7 +52,7 @@ ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in) ngx_test_null(sfv, ngx_push_array(&vec), NGX_CHAIN_ERROR); sfv->sfv_fd = SFV_FD_SELF; sfv->sfv_flag = 0; - sfv->sfv_off = cl->hunk->pos; + sfv->sfv_off = (off_t) (uintptr_t) cl->hunk->pos; sfv->sfv_len = cl->hunk->last - cl->hunk->pos; } @@ -72,7 +77,7 @@ ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in) } } - n = sendfile(c->fd, vec->elts, vec->nelts, &sent); + n = sendfilev(c->fd, vec.elts, vec.nelts, &sent); if (n == -1) { err = ngx_errno; @@ -93,7 +98,7 @@ ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in) } #if (NGX_DEBUG_WRITE_CHAIN) - ngx_log_debug(c->log, "sendfilev: %d " SIZE_T_FMT ", n _ sent); + ngx_log_debug(c->log, "sendfilev: %d " SIZE_T_FMT _ n _ sent); #endif c->sent += sent; |