diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-09-24 20:44:13 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-09-24 20:44:13 +0400 |
commit | cf7e26ba460d22ed1c0934f8e35292f420f1afd9 (patch) | |
tree | 916f83982eac7a71bb67a5b9effc994019840875 /src | |
parent | ae5c59ca70bd1730e1b5d41dc8e725662dc03643 (diff) |
nginx-0.0.1-2003-09-24-20:44:13 import
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ngx_hunk.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/core/ngx_hunk.c b/src/core/ngx_hunk.c index 32a52c928..29b88772a 100644 --- a/src/core/ngx_hunk.c +++ b/src/core/ngx_hunk.c @@ -97,3 +97,43 @@ ngx_hunk_t *ngx_create_hunk_after(ngx_pool_t *pool, ngx_hunk_t *hunk, int size) return h; } + + +void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, + ngx_chain_t **out) +{ + ngx_chain_t *te; + + if (*busy == NULL) { + *busy = *out; + + } else { + for (te = *busy; /* void */ ; te = te->next) { + if (te->next == NULL) { + te->next = *out; + break; + } + } + } + + *out = NULL; + + while (*busy) { + if ((*busy)->hunk->pos != (*busy)->hunk->last) { + break; + } + +#if (HAVE_WRITE_ZEROCOPY) + if ((*busy)->hunk->type & NGX_HUNK_ZEROCOPY_BUSY) { + break; + } +#endif + + (*busy)->hunk->pos = (*busy)->hunk->last = (*busy)->hunk->start; + + te = *busy; + *busy = (*busy)->next; + te->next = *free; + *free = te; + } +} |