diff src/os/unix/ngx_writev_chain.c @ 343:6bdf858bff8c

nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
author Igor Sysoev <igor@sysoev.ru>
date Fri, 28 May 2004 15:49:23 +0000
parents 87e73f067470
children 7650aea1816f
line wrap: on
line diff
--- a/src/os/unix/ngx_writev_chain.c
+++ b/src/os/unix/ngx_writev_chain.c
@@ -41,19 +41,19 @@ ngx_chain_t *ngx_writev_chain(ngx_connec
         iov = NULL;
         eintr = 0;
 
-        /* create the iovec and coalesce the neighbouring hunks */
+        /* create the iovec and coalesce the neighbouring bufs */
 
         for (cl = in; cl; cl = cl->next) {
 
-            if (prev == cl->hunk->pos) {
-                iov->iov_len += cl->hunk->last - cl->hunk->pos;
-                prev = cl->hunk->last;
+            if (prev == cl->buf->pos) {
+                iov->iov_len += cl->buf->last - cl->buf->pos;
+                prev = cl->buf->last;
 
             } else {
                 ngx_test_null(iov, ngx_push_array(&io), NGX_CHAIN_ERROR);
-                iov->iov_base = (void *) cl->hunk->pos;
-                iov->iov_len = cl->hunk->last - cl->hunk->pos;
-                prev = cl->hunk->last;
+                iov->iov_base = (void *) cl->buf->pos;
+                iov->iov_len = cl->buf->last - cl->buf->pos;
+                prev = cl->buf->last;
             }
         }
 
@@ -86,20 +86,20 @@ ngx_chain_t *ngx_writev_chain(ngx_connec
 
         for (cl = in; cl && sent > 0; cl = cl->next) {
 
-            size = cl->hunk->last - cl->hunk->pos;
+            size = cl->buf->last - cl->buf->pos;
 
             if (sent >= size) {
                 sent -= size;
 
-                if (cl->hunk->type & NGX_HUNK_IN_MEMORY) {
-                    cl->hunk->pos = cl->hunk->last;
+                if (ngx_buf_in_memory(cl->buf)) {
+                    cl->buf->pos = cl->buf->last;
                 }
 
                 continue;
             }
 
-            if (cl->hunk->type & NGX_HUNK_IN_MEMORY) {
-                cl->hunk->pos += sent;
+            if (ngx_buf_in_memory(cl->buf)) {
+                cl->buf->pos += sent;
             }
 
             break;