aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-10-22 07:05:29 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-10-22 07:05:29 +0000
commit5bf3d25d69ecdbccaa98beeb089a7a6850529b89 (patch)
tree1bc211941faf078f87f79bea1f2703e3190483fa /src/core
parent419f9aceb4d994c2f7f51400f59fb2da0ed666d4 (diff)
downloadnginx-5bf3d25d69ecdbccaa98beeb089a7a6850529b89.tar.gz
nginx-5bf3d25d69ecdbccaa98beeb089a7a6850529b89.zip
nginx-0.0.1-2003-10-22-11:05:29 import
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_hunk.c6
-rw-r--r--src/core/ngx_hunk.h31
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);