comparison src/os/unix/ngx_aio_write_chain.c @ 10:46833bd150cb NGINX_0_1_5

nginx 0.1.5 *) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
author Igor Sysoev <http://sysoev.ru>
date Thu, 11 Nov 2004 00:00:00 +0300
parents f0b350454894
children 8b6db3bda591
comparison
equal deleted inserted replaced
9:77eee314ddbd 10:46833bd150cb
11 11
12 12
13 ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in, 13 ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in,
14 off_t limit) 14 off_t limit)
15 { 15 {
16 int n;
17 u_char *buf, *prev; 16 u_char *buf, *prev;
18 off_t send, sent; 17 off_t send, sent;
19 size_t len; 18 size_t len;
20 ssize_t size; 19 ssize_t n, size;
21 ngx_err_t err; 20 ngx_err_t err;
22 ngx_chain_t *cl; 21 ngx_chain_t *cl;
23 22
24 send = 0; 23 send = 0;
25 sent = 0; 24 sent = 0;
61 cl = cl->next; 60 cl = cl->next;
62 } 61 }
63 62
64 n = ngx_aio_write(c, buf, len); 63 n = ngx_aio_write(c, buf, len);
65 64
66 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "aio_write: %d", n); 65 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "aio_write: %z", n);
67 66
68 if (n == NGX_ERROR) { 67 if (n == NGX_ERROR) {
69 return NGX_CHAIN_ERROR; 68 return NGX_CHAIN_ERROR;
70 } 69 }
71 70
73 sent += n; 72 sent += n;
74 c->sent += n; 73 c->sent += n;
75 } 74 }
76 75
77 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, 76 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
78 "aio_write sent: " OFF_T_FMT, c->sent); 77 "aio_write sent: %O", c->sent);
79 78
80 for (cl = in; cl; cl = cl->next) { 79 for (cl = in; cl; cl = cl->next) {
81 80
82 if (sent >= cl->buf->last - cl->buf->pos) { 81 if (sent >= cl->buf->last - cl->buf->pos) {
83 sent -= cl->buf->last - cl->buf->pos; 82 sent -= cl->buf->last - cl->buf->pos;