summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-09 20:03:38 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-09 20:03:38 +0000
commit74e95c224ad84c6b84b5a834f49c014a441916b5 (patch)
treefea6b4e7b2706f089e462d201e90ec95f5a98fa2 /src/core
parente8732b06b94ea5f8a25fa3e71cece7d93f5ac0b8 (diff)
downloadnginx-74e95c224ad84c6b84b5a834f49c014a441916b5.tar.gz
nginx-74e95c224ad84c6b84b5a834f49c014a441916b5.tar.bz2
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_conf_file.c10
-rw-r--r--src/core/ngx_conf_file.h13
-rw-r--r--src/core/ngx_modules.c6
-rw-r--r--src/core/ngx_string.c14
4 files changed, 28 insertions, 15 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index d2484bb39..24aa096fd 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -168,7 +168,15 @@ ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
} else if (cmd->type & NGX_CONF_1MORE) {
- if (cf->args->nelts != 1) {
+ if (cf->args->nelts > 1) {
+ valid = 1;
+ } else {
+ valid = 0;
+ }
+
+ } else if (cmd->type & NGX_CONF_2MORE) {
+
+ if (cf->args->nelts > 2) {
valid = 1;
} else {
valid = 0;
diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h
index b2dce803d..d460fbe45 100644
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -23,14 +23,19 @@
#define NGX_CONF_TAKE8 0x00000100
#define NGX_CONF_TAKE9 0x00000200
+#define NGX_CONF_TAKE12 (NGX_CONF_TAKE1|NGX_CONF_TAKE2)
+
+#define NGX_CONF_TAKE13 (NGX_CONF_TAKE1|NGX_CONF_TAKE3)
+
#define NGX_CONF_TAKE1234 (NGX_CONF_TAKE1|NGX_CONF_TAKE2|NGX_CONF_TAKE3 \
|NGX_CONF_TAKE4)
#define NGX_CONF_ARGS_NUMBER 0x0000ffff
-#define NGX_CONF_ANY 0x00010000
-#define NGX_CONF_1MORE 0x00020000
-#define NGX_CONF_BLOCK 0x00040000
-#define NGX_CONF_FLAG 0x00080000
+#define NGX_CONF_BLOCK 0x00010000
+#define NGX_CONF_FLAG 0x00020000
+#define NGX_CONF_ANY 0x00040000
+#define NGX_CONF_1MORE 0x00080000
+#define NGX_CONF_2MORE 0x00100000
#define NGX_MAIN_CONF 0x01000000
diff --git a/src/core/ngx_modules.c b/src/core/ngx_modules.c
index dfe0243ad..c3159ad84 100644
--- a/src/core/ngx_modules.c
+++ b/src/core/ngx_modules.c
@@ -27,6 +27,7 @@ extern ngx_module_t ngx_aio_module;
extern ngx_module_t ngx_http_module;
extern ngx_module_t ngx_http_core_module;
+extern ngx_module_t ngx_http_log_module;
extern ngx_module_t ngx_http_write_filter_module;
extern ngx_module_t ngx_http_output_filter_module;
@@ -42,8 +43,6 @@ extern ngx_module_t ngx_http_static_module;
extern ngx_module_t ngx_http_index_module;
extern ngx_module_t ngx_http_proxy_module;
-extern ngx_module_t ngx_http_log_module;
-
ngx_module_t *ngx_modules[] = {
@@ -78,6 +77,7 @@ ngx_module_t *ngx_modules[] = {
&ngx_http_module,
&ngx_http_core_module,
+ &ngx_http_log_module,
&ngx_http_write_filter_module,
&ngx_http_output_filter_module,
&ngx_http_header_filter_module,
@@ -93,7 +93,5 @@ ngx_module_t *ngx_modules[] = {
&ngx_http_index_module,
&ngx_http_proxy_module,
- &ngx_http_log_module,
-
NULL
};
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index 962674e2f..87b6a0957 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -71,13 +71,15 @@ int ngx_atoi(char *line, size_t n)
void ngx_md5_text(char *text, u_char *md5)
{
- /* STUB */
+ int i;
+ static char hex[] = "0123456789abcdef";
- ngx_snprintf(text, 33,
- "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
- md5[0], md5[1], md5[2], md5[3], md5[4], md5[5],
- md5[6], md5[7], md5[8], md5[9], md5[10], md5[11],
- md5[12], md5[13], md5[14], md5[15]);
+ for (i = 0; i < 16; i++) {
+ *text++ = hex[md5[i] >> 4];
+ *text++ = hex[md5[i] & 0xf];
+ }
+
+ *text = '\0';
}