summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-07-30 12:34:04 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-07-30 12:34:04 +0000
commit385af286421e983f744f7f5d339b8060ccd36302 (patch)
tree81c46d0dad40506cc3a331c6ffaf454da85a0177 /src/http
parent749449097847cc3bee9e4e3966122a94149b755b (diff)
downloadnginx-385af286421e983f744f7f5d339b8060ccd36302.tar.gz
nginx-385af286421e983f744f7f5d339b8060ccd36302.tar.bz2
directio
Diffstat (limited to 'src/http')
-rw-r--r--src/http/modules/ngx_http_flv_module.c1
-rw-r--r--src/http/modules/ngx_http_gzip_static_module.c1
-rw-r--r--src/http/modules/ngx_http_index_module.c1
-rw-r--r--src/http/modules/ngx_http_static_module.c1
-rw-r--r--src/http/modules/perl/nginx.xs1
-rw-r--r--src/http/ngx_http_core_module.c39
-rw-r--r--src/http/ngx_http_core_module.h1
-rw-r--r--src/http/ngx_http_script.c1
8 files changed, 46 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_flv_module.c b/src/http/modules/ngx_http_flv_module.c
index bed1b48a6..dceb68abc 100644
--- a/src/http/modules/ngx_http_flv_module.c
+++ b/src/http/modules/ngx_http_flv_module.c
@@ -107,6 +107,7 @@ ngx_http_flv_handler(ngx_http_request_t *r)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c
index 51fe0d56d..bc3a65f11 100644
--- a/src/http/modules/ngx_http_gzip_static_module.c
+++ b/src/http/modules/ngx_http_gzip_static_module.c
@@ -121,6 +121,7 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c
index bc4cd5009..6d4cf34d3 100644
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -210,6 +210,7 @@ ngx_http_index_handler(ngx_http_request_t *r)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c
index ce2f0fc65..8d399fccd 100644
--- a/src/http/modules/ngx_http_static_module.c
+++ b/src/http/modules/ngx_http_static_module.c
@@ -98,6 +98,7 @@ ngx_http_static_handler(ngx_http_request_t *r)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs
index f86b76f3e..6e7ad7760 100644
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -652,6 +652,7 @@ sendfile(r, filename, offset = -1, bytes = 0)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 0ddfc04d1..468b3e151 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -54,6 +54,8 @@ static char *ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd,
static char *ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static char *ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
+static char *ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd,
+ void *conf);
static char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static char *ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd,
@@ -353,6 +355,13 @@ static ngx_command_t ngx_http_core_commands[] = {
offsetof(ngx_http_core_loc_conf_t, sendfile_max_chunk),
NULL },
+ { ngx_string("directio"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_http_core_directio,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ 0,
+ NULL },
+
{ ngx_string("tcp_nopush"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
ngx_conf_set_flag_slot,
@@ -2586,6 +2595,7 @@ ngx_http_core_create_loc_conf(ngx_conf_t *cf)
lcf->client_body_in_file_only = NGX_CONF_UNSET;
lcf->sendfile = NGX_CONF_UNSET;
lcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE;
+ lcf->directio = NGX_CONF_UNSET;
lcf->tcp_nopush = NGX_CONF_UNSET;
lcf->tcp_nodelay = NGX_CONF_UNSET;
lcf->send_timeout = NGX_CONF_UNSET_MSEC;
@@ -2774,6 +2784,8 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
ngx_conf_merge_size_value(conf->sendfile_max_chunk,
prev->sendfile_max_chunk, 0);
+ ngx_conf_merge_off_value(conf->directio, prev->directio,
+ NGX_MAX_OFF_T_VALUE);
ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0);
ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1);
@@ -3340,6 +3352,33 @@ ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
static char *
+ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+{
+ ngx_http_core_loc_conf_t *clcf = conf;
+
+ ngx_str_t *value;
+
+ if (clcf->directio != NGX_CONF_UNSET) {
+ return "is duplicate";
+ }
+
+ value = cf->args->elts;
+
+ if (ngx_strcmp(value[1].data, "off") == 0) {
+ clcf->directio = NGX_MAX_OFF_T_VALUE;
+ return NGX_CONF_OK;
+ }
+
+ clcf->directio = ngx_parse_offset(&value[1]);
+ if (clcf->directio == (off_t) NGX_ERROR) {
+ return "invalid value";
+ }
+
+ return NGX_CONF_OK;
+}
+
+
+static char *
ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_http_core_loc_conf_t *lcf = conf;
diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h
index 85d96b079..57ee748e7 100644
--- a/src/http/ngx_http_core_module.h
+++ b/src/http/ngx_http_core_module.h
@@ -265,6 +265,7 @@ struct ngx_http_core_loc_conf_s {
ngx_str_t default_type;
off_t client_max_body_size; /* client_max_body_size */
+ off_t directio; /* directio */
size_t client_body_buffer_size; /* client_body_buffer_size */
size_t send_lowat; /* send_lowat */
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index 7a47417e4..0ffa07cc8 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -996,6 +996,7 @@ ngx_http_script_file_code(ngx_http_script_engine_t *e)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;