aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
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/http/ngx_http_core_module.c
parent419f9aceb4d994c2f7f51400f59fb2da0ed666d4 (diff)
downloadnginx-5bf3d25d69ecdbccaa98beeb089a7a6850529b89.tar.gz
nginx-5bf3d25d69ecdbccaa98beeb089a7a6850529b89.zip
nginx-0.0.1-2003-10-22-11:05:29 import
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 73d089574..601568377 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -130,6 +130,13 @@ static ngx_command_t ngx_http_core_commands[] = {
offsetof(ngx_http_core_loc_conf_t, doc_root),
NULL},
+ {ngx_string("sendfile"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_flag_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_core_loc_conf_t, sendfile),
+ NULL},
+
{ngx_string("send_timeout"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
ngx_conf_set_msec_slot,
@@ -334,7 +341,6 @@ int ngx_http_find_location_config(ngx_http_request_t *r)
int i, rc;
ngx_http_core_loc_conf_t *clcf, **clcfp;
ngx_http_core_srv_conf_t *cscf;
- ngx_http_write_filter_conf_t *wcf;
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
@@ -364,13 +370,14 @@ ngx_log_debug(r->connection->log, "rc: %d" _ rc);
}
}
- wcf = ngx_http_get_module_loc_conf(r, ngx_http_write_filter_module);
+ clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- if (!(ngx_io.flags & NGX_IO_SENDFILE) || !wcf->sendfile) {
- r->filter = NGX_HTTP_FILTER_NEED_IN_MEMORY;
- }
+ if (!(ngx_io.flags & NGX_IO_SENDFILE) || !clcf->sendfile) {
+ r->sendfile = 0;
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+ } else {
+ r->sendfile = 1;
+ }
if (clcf->handler) {
/*
@@ -828,6 +835,7 @@ static void *ngx_http_core_create_loc_conf(ngx_conf_t *cf)
*/
+ lcf->sendfile = NGX_CONF_UNSET;
lcf->send_timeout = NGX_CONF_UNSET;
lcf->discarded_buffer_size = NGX_CONF_UNSET;
lcf->keepalive_timeout = NGX_CONF_UNSET;
@@ -896,6 +904,7 @@ static char *ngx_http_core_merge_loc_conf(ngx_conf_t *cf,
ngx_conf_merge_str_value(conf->default_type,
prev->default_type, "text/plain");
+ ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 10000);
ngx_conf_merge_size_value(conf->discarded_buffer_size,
prev->discarded_buffer_size, 1500);