diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ngx_hunk.c | 6 | ||||
-rw-r--r-- | src/core/ngx_hunk.h | 31 |
2 files changed, 19 insertions, 18 deletions
diff --git a/src/core/ngx_hunk.c b/src/core/ngx_hunk.c index 6bed8c566..cd218307d 100644 --- a/src/core/ngx_hunk.c +++ b/src/core/ngx_hunk.c @@ -125,7 +125,7 @@ int ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **ch, ngx_chain_t *in) void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, - ngx_chain_t **out) + ngx_chain_t **out, ngx_hunk_tag_t tag) { ngx_chain_t *te; @@ -154,9 +154,7 @@ void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, } #endif - /* TODO: change to hunk->tag */ - - if (!((*busy)->hunk->type & NGX_HUNK_TEMP)) { + if ((*busy)->hunk->tag != tag) { *busy = (*busy)->next; continue; } diff --git a/src/core/ngx_hunk.h b/src/core/ngx_hunk.h index 3a10076cc..940241be7 100644 --- a/src/core/ngx_hunk.h +++ b/src/core/ngx_hunk.h @@ -34,25 +34,28 @@ /* last hunk */ #define NGX_HUNK_LAST 0x2000 #define NGX_HUNK_LAST_SHADOW 0x4000 +#define NGX_HUNK_TEMP_FILE 0x8000 +typedef void * ngx_hunk_tag_t; typedef struct ngx_hunk_s ngx_hunk_t; struct ngx_hunk_s { - char *pos; - char *last; - off_t file_pos; - off_t file_last; - - int type; - char *start; /* start of hunk */ - char *end; /* end of hunk */ - char *pre_start; /* start of pre-allocated hunk */ - char *post_end; /* end of post-allocated hunk */ - int tag; - ngx_file_t *file; - ngx_hunk_t *shadow; + char *pos; + char *last; + off_t file_pos; + off_t file_last; + + int type; + char *start; /* start of hunk */ + char *end; /* end of hunk */ + char *pre_start; /* start of pre-allocated hunk */ + char *post_end; /* end of post-allocated hunk */ + ngx_hunk_tag_t tag; + ngx_file_t *file; + ngx_hunk_t *shadow; + /* STUB */ int num; }; @@ -119,7 +122,7 @@ ngx_hunk_t *ngx_create_temp_hunk(ngx_pool_t *pool, int size, int ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **ch, ngx_chain_t *in); void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, - ngx_chain_t **out); + ngx_chain_t **out, ngx_hunk_tag_t tag); |