comparison src/os/unix/ngx_aio_write_chain.c @ 257:70e1c7d2b83d

nginx-0.0.2-2004-02-11-20:08:49 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 11 Feb 2004 17:08:49 +0000
parents e885208c518b
children 4a3f18406832
comparison
equal deleted inserted replaced
256:8e39cab6abd5 257:70e1c7d2b83d
42 cl = cl->next; 42 cl = cl->next;
43 } 43 }
44 44
45 n = ngx_aio_write(c, buf, size); 45 n = ngx_aio_write(c, buf, size);
46 46
47 #if (NGX_DEBUG_WRITE_CHAIN) 47 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "aio_write: %d", n);
48 ngx_log_debug(c->log, "aio_write: %d" _ n);
49 #endif
50 48
51 if (n == NGX_ERROR) { 49 if (n == NGX_ERROR) {
52 return NGX_CHAIN_ERROR; 50 return NGX_CHAIN_ERROR;
53 } 51 }
54 52
55 if (n > 0) { 53 if (n > 0) {
56 sent += n; 54 sent += n;
57 c->sent += n; 55 c->sent += n;
58 } 56 }
59 57
60 #if (NGX_DEBUG_WRITE_CHAIN) 58 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
61 ngx_log_debug(c->log, "aio_write sent: " OFF_T_FMT _ c->sent); 59 "aio_write sent: " OFF_T_FMT, c->sent);
62 #endif
63 60
64 for (cl = in; cl; cl = cl->next) { 61 for (cl = in; cl; cl = cl->next) {
65 62
66 if (sent >= cl->hunk->last - cl->hunk->pos) { 63 if (sent >= cl->hunk->last - cl->hunk->pos) {
67 sent -= cl->hunk->last - cl->hunk->pos; 64 sent -= cl->hunk->last - cl->hunk->pos;