aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_core.c')
-rw-r--r--src/http/ngx_http_core.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/http/ngx_http_core.c b/src/http/ngx_http_core.c
index a42e7cc27..d8f829423 100644
--- a/src/http/ngx_http_core.c
+++ b/src/http/ngx_http_core.c
@@ -6,7 +6,8 @@
#include <ngx_http_config.h>
-static void *ngx_http_core_create_conf(ngx_pool_t *pool);
+static void *ngx_http_core_create_srv_conf(ngx_pool_t *pool);
+static void *ngx_http_core_create_loc_conf(ngx_pool_t *pool);
static ngx_command_t ngx_http_core_commands[];
@@ -14,8 +15,8 @@ static ngx_command_t ngx_http_core_commands[];
ngx_http_module_t ngx_http_core_module = {
NGX_HTTP_MODULE,
- NULL, /* create server config */
- ngx_http_core_create_conf, /* create location config */
+ ngx_http_core_create_srv_conf, /* create server config */
+ ngx_http_core_create_loc_conf, /* create location config */
ngx_http_core_commands, /* module directives */
NULL, /* init module */
NULL /* init output body filter */
@@ -25,7 +26,7 @@ ngx_http_module_t ngx_http_core_module = {
static ngx_command_t ngx_http_core_commands[] = {
{"send_timeout", ngx_conf_set_time_slot,
- offsetof(ngx_http_core_conf_t, send_timeout),
+ offsetof(ngx_http_core_loc_conf_t, send_timeout),
NGX_HTTP_LOC_CONF, NGX_CONF_TAKE1,
"set timeout for sending response"},
@@ -34,12 +35,23 @@ static ngx_command_t ngx_http_core_commands[] = {
};
-static void *ngx_http_core_create_conf(ngx_pool_t *pool)
+static void *ngx_http_core_create_srv_conf(ngx_pool_t *pool)
+{
+ ngx_http_core_srv_conf_t *conf;
+
+ ngx_test_null(conf,
+ ngx_pcalloc(pool, sizeof(ngx_http_core_srv_conf_t)),
+ NULL);
+
+ return conf;
+}
+
+static void *ngx_http_core_create_loc_conf(ngx_pool_t *pool)
{
- ngx_http_core_conf_t *conf;
+ ngx_http_core_loc_conf_t *conf;
ngx_test_null(conf,
- ngx_pcalloc(pool, sizeof(ngx_http_core_conf_t)),
+ ngx_pcalloc(pool, sizeof(ngx_http_core_loc_conf_t)),
NULL);
conf->send_timeout = NGX_CONF_UNSET;
@@ -47,3 +59,15 @@ static void *ngx_http_core_create_conf(ngx_pool_t *pool)
return conf;
}
+#if 0
+static void *ngx_http_core_create_conf(ngx_pool_t *pool)
+{
+
+ ngx_test_null(conf, ngx_palloc(pool, sizeof(ngx_http_core_conf_t)), NULL);
+
+ ngx_test_null(conf->srv, ngx_http_core_create_srv_conf_t(pool), NULL);
+ ngx_test_null(conf->loc, ngx_http_core_create_loc_conf_t(pool), NULL);
+ conf->parent =
+ conf->next = NULL;
+}
+#endif