summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_conf_file.h2
-rw-r--r--src/core/ngx_file.c4
-rw-r--r--src/core/ngx_file.h3
-rw-r--r--src/core/ngx_hunk.h9
-rw-r--r--src/core/ngx_output_chain.c8
5 files changed, 18 insertions, 8 deletions
diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h
index 4bf674751..c1e2c010e 100644
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -150,6 +150,8 @@ typedef struct {
} ngx_conf_num_bounds_t;
+#define NGX_CONF_BITMASK_SET 1
+
typedef struct {
ngx_str_t name;
int mask;
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c
index 84e86fffc..80ad9dc8a 100644
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -12,7 +12,7 @@ int ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain)
int rc;
if (tf->file.fd == NGX_INVALID_FILE) {
- rc = ngx_create_temp_file(&tf->file, &tf->path, tf->pool,
+ rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool,
tf->persistent);
if (rc == NGX_ERROR || rc == NGX_AGAIN) {
@@ -24,7 +24,7 @@ int ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain)
}
}
- return ngx_write_chain_to_file(&tf->file, chain, tf->file.offset, tf->pool);
+ return ngx_write_chain_to_file(&tf->file, chain, tf->offset, tf->pool);
}
diff --git a/src/core/ngx_file.h b/src/core/ngx_file.h
index 660750a4c..8cf4c7db0 100644
--- a/src/core/ngx_file.h
+++ b/src/core/ngx_file.h
@@ -28,7 +28,8 @@ typedef struct {
typedef struct {
ngx_file_t file;
- ngx_path_t path;
+ off_t offset;
+ ngx_path_t *path;
ngx_pool_t *pool;
char *warn;
diff --git a/src/core/ngx_hunk.h b/src/core/ngx_hunk.h
index e68ba6d22..2c6664b60 100644
--- a/src/core/ngx_hunk.h
+++ b/src/core/ngx_hunk.h
@@ -20,7 +20,7 @@
#define NGX_HUNK_RECYCLED 0x0010
/* the hunk is in file */
-#define NGX_HUNK_FILE 0x0100
+#define NGX_HUNK_FILE 0x0020
#define NGX_HUNK_STORAGE (NGX_HUNK_IN_MEMORY \
|NGX_HUNK_TEMP|NGX_HUNK_MEMORY|NGX_HUNK_MMAP \
@@ -30,9 +30,12 @@
/* in thread state flush means to write the hunk completely before return */
/* in event state flush means to start to write the hunk */
-#define NGX_HUNK_FLUSH 0x1000
+#define NGX_HUNK_FLUSH 0x0100
/* last hunk */
-#define NGX_HUNK_LAST 0x2000
+#define NGX_HUNK_LAST 0x0200
+
+
+#define NGX_HUNK_PREREAD 0x2000
#define NGX_HUNK_LAST_SHADOW 0x4000
#define NGX_HUNK_TEMP_FILE 0x8000
diff --git a/src/core/ngx_output_chain.c b/src/core/ngx_output_chain.c
index 69ed5bc55..f196937ef 100644
--- a/src/core/ngx_output_chain.c
+++ b/src/core/ngx_output_chain.c
@@ -169,8 +169,12 @@ ngx_inline static int ngx_output_chain_need_to_copy(ngx_output_chain_ctx_t *ctx,
return 0;
}
- if (!ctx->sendfile && (!(hunk->type & NGX_HUNK_IN_MEMORY))) {
- return 1;
+ if (!ctx->sendfile) {
+ if (!(hunk->type & NGX_HUNK_IN_MEMORY)) {
+ return 1;
+ }
+
+ hunk->type &= ~NGX_HUNK_FILE;
}
if (ctx->need_in_memory && (!(hunk->type & NGX_HUNK_IN_MEMORY))) {