aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_aio_write_chain.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-05-23 11:53:01 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-05-23 11:53:01 +0000
commit187fcd82410e0f9022b0090a27b040eb1211c3f5 (patch)
treefd5b8310596a1a09120751929077899532fdda87 /src/os/unix/ngx_aio_write_chain.c
parent6a1cc903bf2db47b7061791b9e878ededcba1aa4 (diff)
downloadnginx-187fcd82410e0f9022b0090a27b040eb1211c3f5.tar.gz
nginx-187fcd82410e0f9022b0090a27b040eb1211c3f5.zip
nginx-0.0.1-2003-05-23-15:53:01 import
Diffstat (limited to 'src/os/unix/ngx_aio_write_chain.c')
-rw-r--r--src/os/unix/ngx_aio_write_chain.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/os/unix/ngx_aio_write_chain.c b/src/os/unix/ngx_aio_write_chain.c
index 14586ce40..b12afec41 100644
--- a/src/os/unix/ngx_aio_write_chain.c
+++ b/src/os/unix/ngx_aio_write_chain.c
@@ -17,9 +17,6 @@ ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in)
ce = in;
while (ce) {
-
-ngx_log_debug(c->log, "aio_write ce: %x" _ ce->hunk->pos);
-
buf = prev = ce->hunk->pos;
size = 0;
@@ -32,7 +29,9 @@ ngx_log_debug(c->log, "aio_write ce: %x" _ ce->hunk->pos);
rc = ngx_aio_write(c, buf, size);
-ngx_log_debug(c->log, "aio_write rc: %d" _ rc);
+#if (NGX_DEBUG_WRITE_CHAIN)
+ ngx_log_debug(c->log, "aio_write rc: %d" _ rc);
+#endif
if (rc > 0) {
sent += rc;
@@ -52,31 +51,14 @@ ngx_log_debug(c->log, "aio_write rc: %d" _ rc);
for (ce = in; ce; ce = ce->next) {
-#if (NGX_DEBUG_WRITE_CHAIN)
- ngx_log_debug(c->log, "write chain: %x %qx %qd" _
- ce->hunk->type _
- ce->hunk->file_pos _
- ce->hunk->file_last - ce->hunk->file_pos);
-#endif
-
- if (sent >= ce->hunk->file_last - ce->hunk->file_pos) {
- sent -= ce->hunk->file_last - ce->hunk->file_pos;
- ce->hunk->file_pos = ce->hunk->file_last;
+ if (sent >= ce->hunk->last - ce->hunk->pos) {
+ sent -= ce->hunk->last - ce->hunk->pos;
+ ce->hunk->pos = ce->hunk->last;
-#if (NGX_DEBUG_WRITE_CHAIN)
- ngx_log_debug(c->log, "write chain done: %qx %qd" _
- ce->hunk->file_pos _ sent);
-#endif
continue;
}
- ce->hunk->file_pos += sent;
-
-#if (NGX_DEBUG_WRITE_CHAIN)
- ngx_log_debug(c->log, "write chain rest: %qx %qd" _
- ce->hunk->file_pos _
- ce->hunk->file_last - ce->hunk->file_pos);
-#endif
+ ce->hunk->pos += sent;
break;
}