Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2002-12-27 19:22:50 +0300
committerIgor Sysoev <igor@sysoev.ru>2002-12-27 19:22:50 +0300
commitc1817846d29be14903e40a0551f706ff50e09dcf (patch)
tree343cd7b85ba91604fbda03378be00d8b761d87df /src
parent6b5c0f70d7cdcc8ac9e63989efcf6911aaf9ab05 (diff)
nginx-0.0.1-2002-12-27-19:22:50 import
Diffstat (limited to 'src')
-rw-r--r--src/core/nginx.c3
-rw-r--r--src/core/ngx_conf_file.c (renamed from src/core/ngx_config_file.c)8
-rw-r--r--src/core/ngx_conf_file.h (renamed from src/core/ngx_config_file.h)24
-rw-r--r--src/core/ngx_modules.c2
-rw-r--r--src/http/modules/ngx_http_index_handler.c4
-rw-r--r--src/http/ngx_http.h3
-rw-r--r--src/http/ngx_http_config.c21
-rw-r--r--src/http/ngx_http_core.c4
-rw-r--r--src/http/ngx_http_header_filter.c4
-rw-r--r--src/http/ngx_http_output_filter.c4
-rw-r--r--src/http/ngx_http_output_filter.h1
-rw-r--r--src/http/ngx_http_write_filter.c4
12 files changed, 57 insertions, 25 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 17a3d10c3..0a0233f49 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -2,6 +2,7 @@
#include <nginx.h>
#include <ngx_config.h>
+
#include <ngx_string.h>
#include <ngx_errno.h>
#include <ngx_time.h>
@@ -12,6 +13,7 @@
#include <ngx_server.h>
#include <ngx_connection.h>
#include <ngx_listen.h>
+#include <ngx_conf_file.h>
/* STUB */
#include <ngx_http.h>
@@ -62,6 +64,7 @@ int main(int argc, char *const *argv)
ngx_create_array(ngx_pool, 10, sizeof(ngx_str_t)), 1);
conf.pool = ngx_pool;
conf.log = &ngx_log;
+ conf.type = NGX_CORE_MODULE_TYPE;
conf_file.len = sizeof("nginx.conf") - 1;
conf_file.data = "nginx.conf";
diff --git a/src/core/ngx_config_file.c b/src/core/ngx_conf_file.c
index 79d72183c..6b77121a4 100644
--- a/src/core/ngx_config_file.c
+++ b/src/core/ngx_conf_file.c
@@ -1,7 +1,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
static int argument_number[] = {
@@ -75,7 +75,9 @@ int ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename)
name = (ngx_str_t *) cf->args->elts;
for (i = 0; ngx_modules[i]; i++) {
- if (cf->type != ngx_modules[i]->type) {
+ if (ngx_modules[i]->type != NULL
+ && ngx_modules[i]->type != cf->type)
+ {
continue;
}
@@ -88,7 +90,9 @@ int ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename)
if (name->len == cmd->name.len
&& ngx_strcmp(name->data, cmd->name.data) == 0)
{
+
ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
+
cmd->set(cf, cmd, NULL);
}
diff --git a/src/core/ngx_config_file.h b/src/core/ngx_conf_file.h
index 97a4d2a33..cab61a351 100644
--- a/src/core/ngx_config_file.h
+++ b/src/core/ngx_conf_file.h
@@ -1,5 +1,5 @@
-#ifndef _NGX_HTTP_CONFIG_FILE_H_INCLUDED_
-#define _NGX_HTTP_CONFIG_FILE_H_INCLUDED_
+#ifndef _NGX_HTTP_CONF_FILE_H_INCLUDED_
+#define _NGX_HTTP_CONF_FILE_H_INCLUDED_
#include <ngx_config.h>
@@ -12,21 +12,25 @@
#include <ngx_array.h>
-#define NGX_CONF_NOARGS 1
-#define NGX_CONF_TAKE1 2
-#define NGX_CONF_TAKE2 4
+#define NGX_CONF_NOARGS 1
+#define NGX_CONF_TAKE1 2
+#define NGX_CONF_TAKE2 4
+#define NGX_CONF_ARGS_NUMBER 0x0ffff
+#define NGX_CONF_ANY 0x10000
+#define NGX_CONF_BLOCK 0x20000
-#define NGX_CONF_ANY 0x10000
-#define NGX_CONF_BLOCK 0x20000
-#define NGX_CONF_UNSET -1
+#define NGX_CONF_UNSET -1
+#define NGX_CONF_ERROR (char *) -1
+
#define NGX_CONF_BLOCK_DONE 1
#define NGX_CONF_FILE_DONE 2
-#define NGX_CONF_ERROR (char *) -1
+#define NGX_CORE_MODULE_TYPE 0x45524f43 /* "CORE" */
+
typedef struct ngx_conf_s ngx_conf_t;
@@ -80,4 +84,4 @@ char *ngx_conf_set_time_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf);
extern ngx_module_t *ngx_modules[];
-#endif _NGX_HTTP_CONFIG_FILE_H_INCLUDED_
+#endif _NGX_HTTP_CONF_FILE_H_INCLUDED_
diff --git a/src/core/ngx_modules.c b/src/core/ngx_modules.c
index ad9372baa..e07c4e6ba 100644
--- a/src/core/ngx_modules.c
+++ b/src/core/ngx_modules.c
@@ -1,7 +1,7 @@
#include <ngx_config.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
extern ngx_module_t ngx_http_header_filter_module;
diff --git a/src/http/modules/ngx_http_index_handler.c b/src/http/modules/ngx_http_index_handler.c
index faddd743a..a85823769 100644
--- a/src/http/modules/ngx_http_index_handler.c
+++ b/src/http/modules/ngx_http_index_handler.c
@@ -1,10 +1,12 @@
#include <ngx_config.h>
+
#include <ngx_core.h>
#include <ngx_errno.h>
#include <ngx_string.h>
#include <ngx_files.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_config.h>
#include <ngx_http_index_handler.h>
diff --git a/src/http/ngx_http.h b/src/http/ngx_http.h
index b6bcfe7cc..4d41bf263 100644
--- a/src/http/ngx_http.h
+++ b/src/http/ngx_http.h
@@ -3,13 +3,14 @@
#include <ngx_config.h>
+
#include <ngx_types.h>
#include <ngx_string.h>
#include <ngx_table.h>
#include <ngx_hunk.h>
#include <ngx_files.h>
#include <ngx_connection.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
#define NGX_HTTP_VERSION_10 1000
diff --git a/src/http/ngx_http_config.c b/src/http/ngx_http_config.c
index eb09d5759..205b41ba0 100644
--- a/src/http/ngx_http_config.c
+++ b/src/http/ngx_http_config.c
@@ -1,7 +1,13 @@
+/* TODO:
+ ngx_http_conf_ctx_t ctx; on stack or in pool ? */
+
+
#include <ngx_config.h>
+
#include <ngx_core.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_core.h>
#include <ngx_http_config.h>
@@ -38,10 +44,11 @@ static ngx_command_t ngx_http_commands[] = {
ngx_module_t ngx_http_module = {
NULL, /* module context */
ngx_http_commands, /* module directives */
- 0, /* module type */
+ NGX_CORE_MODULE_TYPE, /* module type */
NULL /* init module */
};
+
static ngx_command_t ngx_http_core_commands[] = {
{ngx_string("server"),
@@ -83,7 +90,7 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy)
{
int i;
ngx_http_module_t *module;
- ngx_http_conf_ctx_t *ctx;
+ ngx_http_conf_ctx_t ctx;
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->type != NGX_HTTP_MODULE_TYPE) {
@@ -98,9 +105,9 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy)
ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module),
NGX_CONF_ERROR);
- ctx->srv_conf = NULL;
- ctx->loc_conf = null_loc_conf;
- ctx->locations = NULL;
+ ctx.srv_conf = NULL;
+ ctx.loc_conf = null_loc_conf;
+ ctx.locations = NULL;
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->type != NGX_HTTP_MODULE_TYPE) {
@@ -116,7 +123,7 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy)
}
}
- cf->ctx = ctx;
+ cf->ctx = &ctx;
cf->type = NGX_HTTP_MODULE_TYPE;
return ngx_conf_parse(cf, NULL);
}
diff --git a/src/http/ngx_http_core.c b/src/http/ngx_http_core.c
index 848dd8e0e..30d8329df 100644
--- a/src/http/ngx_http_core.c
+++ b/src/http/ngx_http_core.c
@@ -1,7 +1,9 @@
#include <ngx_config.h>
+
#include <ngx_core.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_core.h>
#include <ngx_http_config.h>
diff --git a/src/http/ngx_http_header_filter.c b/src/http/ngx_http_header_filter.c
index aab4e528b..3e8567781 100644
--- a/src/http/ngx_http_header_filter.c
+++ b/src/http/ngx_http_header_filter.c
@@ -2,11 +2,13 @@
#include <nginx.h>
#include <ngx_config.h>
+
#include <ngx_core.h>
#include <ngx_string.h>
#include <ngx_table.h>
#include <ngx_hunk.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_write_filter.h>
diff --git a/src/http/ngx_http_output_filter.c b/src/http/ngx_http_output_filter.c
index f19584580..345a4f161 100644
--- a/src/http/ngx_http_output_filter.c
+++ b/src/http/ngx_http_output_filter.c
@@ -1,10 +1,12 @@
#include <ngx_config.h>
+
#include <ngx_core.h>
#include <ngx_files.h>
#include <ngx_string.h>
#include <ngx_hunk.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_config.h>
#include <ngx_http_output_filter.h>
diff --git a/src/http/ngx_http_output_filter.h b/src/http/ngx_http_output_filter.h
index f409b5468..d8df958bf 100644
--- a/src/http/ngx_http_output_filter.h
+++ b/src/http/ngx_http_output_filter.h
@@ -3,6 +3,7 @@
#include <ngx_hunk.h>
+#include <ngx_conf_file.h>
#include <ngx_http.h>
diff --git a/src/http/ngx_http_write_filter.c b/src/http/ngx_http_write_filter.c
index c4321c7c7..45f6887c9 100644
--- a/src/http/ngx_http_write_filter.c
+++ b/src/http/ngx_http_write_filter.c
@@ -1,8 +1,12 @@
#include <ngx_config.h>
+
#include <ngx_core.h>
#include <ngx_hunk.h>
+#include <ngx_conf_file.h>
+
#include <ngx_event_write.h>
+
#include <ngx_http.h>
#include <ngx_http_config.h>
#include <ngx_http_write_filter.h>