comparison src/os/unix/ngx_writev_chain.c @ 184:1bf718ce0dde

nginx-0.0.1-2003-11-14-10:20:34 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 14 Nov 2003 07:20:34 +0000
parents c42be4185301
children 8dee38ea9117
comparison
equal deleted inserted replaced
183:4c698194c56d 184:1bf718ce0dde
22 22
23 prev = NULL; 23 prev = NULL;
24 iov = NULL; 24 iov = NULL;
25 25
26 /* create the iovec and coalesce the neighbouring hunks */ 26 /* create the iovec and coalesce the neighbouring hunks */
27
27 for (cl = in; cl; cl = cl->next) { 28 for (cl = in; cl; cl = cl->next) {
28 29
29 if (prev == cl->hunk->pos) { 30 if (prev == cl->hunk->pos) {
30 iov->iov_len += cl->hunk->last - cl->hunk->pos; 31 iov->iov_len += cl->hunk->last - cl->hunk->pos;
31 prev = cl->hunk->last; 32 prev = cl->hunk->last;
55 } 56 }
56 57
57 sent = n > 0 ? n : 0; 58 sent = n > 0 ? n : 0;
58 59
59 #if (NGX_DEBUG_WRITE_CHAIN) 60 #if (NGX_DEBUG_WRITE_CHAIN)
60 ngx_log_debug(c->log, "writev: %qd" _ sent); 61 ngx_log_debug(c->log, "writev: " OFF_FMT _ sent);
61 #endif 62 #endif
62 63
63 c->sent += sent; 64 c->sent += sent;
64 65
65 for (cl = in; cl && sent > 0; cl = cl->next) { 66 for (cl = in; cl && sent > 0; cl = cl->next) {
73 74
74 if (cl->hunk->type & NGX_HUNK_IN_MEMORY) { 75 if (cl->hunk->type & NGX_HUNK_IN_MEMORY) {
75 cl->hunk->pos = cl->hunk->last; 76 cl->hunk->pos = cl->hunk->last;
76 } 77 }
77 78
78 #if 0
79 if (cl->hunk->type & NGX_HUNK_FILE) {
80 cl->hunk->file_pos = cl->hunk->file_last;
81 }
82 #endif
83
84 continue; 79 continue;
85 } 80 }
86 81
87 if (cl->hunk->type & NGX_HUNK_IN_MEMORY) { 82 if (cl->hunk->type & NGX_HUNK_IN_MEMORY) {
88 cl->hunk->pos += sent; 83 cl->hunk->pos += sent;
89 } 84 }
90 85
91 #if 0
92 if (cl->hunk->type & NGX_HUNK_FILE) {
93 cl->hunk->file_pos += sent;
94 }
95 #endif
96
97 break; 86 break;
98 } 87 }
99 88
100 return cl; 89 return cl;
101 } 90 }