summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_config.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2002-12-19 07:08:55 +0000
committerIgor Sysoev <igor@sysoev.ru>2002-12-19 07:08:55 +0000
commit8809257531cc21aab3a25bb487e9424175cdfddd (patch)
tree42efffb011487a9e62014a7aee1607d51f233dd6 /src/http/ngx_http_config.c
parent140464d638353addea305e73d247ca6711f668aa (diff)
downloadnginx-8809257531cc21aab3a25bb487e9424175cdfddd.tar.gz
nginx-8809257531cc21aab3a25bb487e9424175cdfddd.tar.bz2
nginx-0.0.1-2002-12-19-10:08:55 import
Diffstat (limited to 'src/http/ngx_http_config.c')
-rw-r--r--src/http/ngx_http_config.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/http/ngx_http_config.c b/src/http/ngx_http_config.c
index 2fb641079..f33fc625d 100644
--- a/src/http/ngx_http_config.c
+++ b/src/http/ngx_http_config.c
@@ -1,7 +1,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
-#include <ngx_config_command.h>
+#include <ngx_config_file.h>
#include <ngx_http.h>
#include <ngx_http_write_filter.h>
#include <ngx_http_output_filter.h>
@@ -17,7 +17,7 @@ void **ngx_srv_conf;
void **ngx_loc_conf;
#if 0
-void *ngx_http_block(ngx_conf_t *cf)
+int ngx_http_block(ngx_conf_t *cf)
{
ngx_http_conf_ctx_t *ctx;
@@ -25,10 +25,12 @@ void *ngx_http_block(ngx_conf_t *cf)
ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)),
NGX_ERROR);
+#if 0
/* null server config */
ngx_test_null(ctx->srv_conf,
ngx_pcalloc(cf->pool, sizeof(void *) * ngx_max_module),
NGX_ERROR);
+#endif
/* null location config */
ngx_test_null(ctx->loc_conf,
@@ -36,10 +38,12 @@ void *ngx_http_block(ngx_conf_t *cf)
NGX_ERROR);
for (i = 0; modules[i]; i++) {
+#if 0
if (modules[i]->create_srv_conf)
ngx_test_null(ctx->srv_conf[i],
modules[i]->create_srv_conf(cf->pool),
NGX_ERROR);
+#endif
if (modules[i]->create_loc_conf)
ngx_test_null(ctx->loc_conf[i],
@@ -51,10 +55,9 @@ void *ngx_http_block(ngx_conf_t *cf)
return ngx_conf_parse(cf);
}
-void *ngx_server_block(ngx_conf_t *cf)
+int ngx_server_block(ngx_conf_t *cf)
{
- ngx_http_conf_ctx_t *ctx, *prev;
- ngx_http_core_loc_conf_t *loc_conf;
+ ngx_http_conf_ctx_t *ctx, *prev;
ngx_test_null(ctx,
ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)),
@@ -88,31 +91,45 @@ void *ngx_server_block(ngx_conf_t *cf)
rc = ngx_conf_parse(cf);
cf->ctx = prev;
- if (loc == NULL)
- return NULL;
+ if (loc == NGX_ERROR)
+ return NGX_ERROR;
for (i = 0; modules[i]; i++) {
+#if 0
if (modules[i]->merge_srv_conf)
if (modules[i]->merge_srv_conf(cf->pool,
prev->srv_conf, ctx->srv_conf)
== NGX_ERROR)
return NGX_ERROR;
+#endif
+
+ if (modules[i]->init_srv_conf)
+ if (modules[i]->init_srv_conf(cf->pool, ctx->srv_conf) == NGX_ERROR)
+ return NGX_ERROR;
if (modules[i]->merge_loc_conf)
if (modules[i]->merge_loc_conf(cf->pool,
prev->loc_conf, ctx->loc_conf)
== NGX_ERROR)
return NGX_ERROR;
+
+ for (array) {
+ if (modules[i]->merge_loc_conf(cf->pool,
+ ctx->loc_conf, loc->loc_conf)
+ == NGX_ERROR)
+ return NGX_ERROR;
+ }
+ }
}
- return (void *) 1;
+ return NGX_OK;
}
-void *ngx_location_block(ngx_conf_t *cf)
+int ngx_location_block(ngx_conf_t *cf)
{
+ ngx_http_conf_ctx_t *ctx, *prev;
- ngx_test_null(ctx,
- ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)),
+ ngx_test_null(ctx, ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)),
NGX_ERROR);
ctx->srv_conf = cf->ctx->srv_conf;