| ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in) |
| buf = prev = ce->hunk->pos; |
| /* coalesce the neighbouring chain entries */ |
| while (ce && prev == ce->hunk->pos) { |
| size += ce->hunk->last - ce->hunk->pos; |
| rc = ngx_aio_write(c, buf, size); |
| #if (NGX_DEBUG_WRITE_CHAIN) |
| ngx_log_debug(c->log, "aio_write rc: %d" _ rc); |
| } else if (rc == NGX_ERROR) { |
| } else if (rc == NGX_AGAIN) { |
| #if (NGX_DEBUG_WRITE_CHAIN) |
| ngx_log_debug(c->log, "aio_write sent: " OFF_FMT _ c->sent); |
| for (ce = in; ce; ce = ce->next) { |
| if (sent >= ce->hunk->last - ce->hunk->pos) { |
| sent -= ce->hunk->last - ce->hunk->pos; |
| ce->hunk->pos = ce->hunk->last; |