Mercurial > hg > nginx
annotate src/core/ngx_conf_file.c @ 1333:07ebeeb55700
escape space, etc in $memcached_key
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 22 Jul 2007 19:18:59 +0000 |
parents | 2c2271d3aac5 |
children | e958b3cab51a 9a6d577807ea |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
5 |
10
4f3879d9b6f6
nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
6 |
4f3879d9b6f6
nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 #include <ngx_config.h> |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
8 #include <ngx_core.h> |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
9 |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
10 |
501 | 11 static ngx_int_t ngx_conf_handler(ngx_conf_t *cf, ngx_int_t last); |
503 | 12 static ngx_int_t ngx_conf_read_token(ngx_conf_t *cf); |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
13 static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
571 | 14 static void ngx_conf_flush_files(ngx_cycle_t *cycle); |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
15 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
16 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
17 static ngx_command_t ngx_conf_commands[] = { |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
18 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
19 { ngx_string("include"), |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
20 NGX_ANY_CONF|NGX_CONF_TAKE1, |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
21 ngx_conf_include, |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
22 0, |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
23 0, |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
24 NULL }, |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
25 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
26 ngx_null_command |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
27 }; |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
28 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
29 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
30 ngx_module_t ngx_conf_module = { |
509 | 31 NGX_MODULE_V1, |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
32 NULL, /* module context */ |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
33 ngx_conf_commands, /* module directives */ |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
34 NGX_CONF_MODULE, /* module type */ |
541 | 35 NULL, /* init master */ |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
36 NULL, /* init module */ |
541 | 37 NULL, /* init process */ |
38 NULL, /* init thread */ | |
39 NULL, /* exit thread */ | |
571 | 40 ngx_conf_flush_files, /* exit process */ |
541 | 41 NULL, /* exit master */ |
42 NGX_MODULE_V1_PADDING | |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
43 }; |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
44 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
45 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
46 /* The ten fixed arguments */ |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
141
diff
changeset
|
47 |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
48 static int argument_number[] = { |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
49 NGX_CONF_NOARGS, |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
50 NGX_CONF_TAKE1, |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
141
diff
changeset
|
51 NGX_CONF_TAKE2, |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
141
diff
changeset
|
52 NGX_CONF_TAKE3, |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
141
diff
changeset
|
53 NGX_CONF_TAKE4, |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
141
diff
changeset
|
54 NGX_CONF_TAKE5, |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
141
diff
changeset
|
55 NGX_CONF_TAKE6, |
311
11ff50a35d6d
nginx-0.0.3-2004-04-12-20:38:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
56 NGX_CONF_TAKE7 |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
57 }; |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
58 |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
59 |
503 | 60 char * |
61 ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename) | |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
62 { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
63 char *rv; |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
64 ngx_fd_t fd; |
501 | 65 ngx_int_t rc; |
629 | 66 ngx_buf_t *b; |
543 | 67 ngx_uint_t block; |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
68 ngx_conf_file_t *prev; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
69 |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
70 #if (NGX_SUPPRESS_WARN) |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
71 fd = NGX_INVALID_FILE; |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
72 prev = NULL; |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
73 #endif |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
74 |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
75 if (filename) { |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
76 |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
77 /* open configuration file */ |
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
78 |
1048
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
988
diff
changeset
|
79 fd = ngx_open_file(filename->data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0); |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
80 if (fd == NGX_INVALID_FILE) { |
581 | 81 ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno, |
593 | 82 ngx_open_file_n " \"%s\" failed", |
83 filename->data); | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
84 return NGX_CONF_ERROR; |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
85 } |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
86 |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
87 prev = cf->conf_file; |
501 | 88 |
89 cf->conf_file = ngx_palloc(cf->pool, sizeof(ngx_conf_file_t)); | |
90 if (cf->conf_file == NULL) { | |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
91 return NGX_CONF_ERROR; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
92 } |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
93 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
94 if (ngx_fd_info(fd, &cf->conf_file->file.info) == -1) { |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
95 ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno, |
461 | 96 ngx_fd_info_n " \"%s\" failed", filename->data); |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
97 } |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
98 |
629 | 99 b = ngx_calloc_buf(cf->pool); |
100 if (b == NULL) { | |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
101 return NGX_CONF_ERROR; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
102 } |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
103 |
629 | 104 cf->conf_file->buffer = b; |
105 | |
106 b->start = ngx_alloc(ngx_pagesize, cf->log); | |
107 if (b->start == NULL) { | |
108 return NGX_CONF_ERROR; | |
109 } | |
110 | |
111 b->pos = b->start; | |
112 b->last = b->start; | |
113 b->end = b->last + ngx_pagesize; | |
114 b->temporary = 1; | |
115 | |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
116 cf->conf_file->file.fd = fd; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
117 cf->conf_file->file.name.len = filename->len; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
118 cf->conf_file->file.name.data = filename->data; |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
119 cf->conf_file->file.offset = 0; |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
120 cf->conf_file->file.log = cf->log;; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
121 cf->conf_file->line = 1; |
543 | 122 |
123 block = 0; | |
124 | |
125 } else { | |
126 block = 1; | |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
127 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
128 |
543 | 129 |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
130 for ( ;; ) { |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
131 rc = ngx_conf_read_token(cf); |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
132 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
133 /* |
461 | 134 * ngx_conf_read_token() may return |
543 | 135 * |
461 | 136 * NGX_ERROR there is error |
137 * NGX_OK the token terminated by ";" was found | |
138 * NGX_CONF_BLOCK_START the token terminated by "{" was found | |
139 * NGX_CONF_BLOCK_DONE the "}" was found | |
140 * NGX_CONF_FILE_DONE the configuration file is done | |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
141 */ |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
142 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
143 if (rc == NGX_ERROR) { |
1123
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
144 goto done; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
145 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
146 |
543 | 147 if (rc == NGX_CONF_BLOCK_DONE) { |
1122
3728476ab96d
stop on superfluous closing "}"
Igor Sysoev <igor@sysoev.ru>
parents:
1107
diff
changeset
|
148 if (!block) { |
3728476ab96d
stop on superfluous closing "}"
Igor Sysoev <igor@sysoev.ru>
parents:
1107
diff
changeset
|
149 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "unexpected \"}\""); |
1123
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
150 goto failed; |
1122
3728476ab96d
stop on superfluous closing "}"
Igor Sysoev <igor@sysoev.ru>
parents:
1107
diff
changeset
|
151 } |
3728476ab96d
stop on superfluous closing "}"
Igor Sysoev <igor@sysoev.ru>
parents:
1107
diff
changeset
|
152 |
543 | 153 block = 0; |
154 } | |
155 | |
156 if (rc == NGX_CONF_FILE_DONE && block) { | |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
157 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
158 "unexpected end of file, expecting \"}\""); |
1123
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
159 goto failed; |
543 | 160 } |
161 | |
461 | 162 if (rc != NGX_OK && rc != NGX_CONF_BLOCK_START) { |
1123
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
163 goto done; |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
164 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
165 |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
166 if (cf->handler) { |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
167 |
461 | 168 /* |
169 * the custom handler, i.e., that is used in the http's | |
170 * "types { ... }" directive | |
171 */ | |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
172 |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
84
diff
changeset
|
173 rv = (*cf->handler)(cf, NULL, cf->handler_conf); |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
84
diff
changeset
|
174 if (rv == NGX_CONF_OK) { |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
84
diff
changeset
|
175 continue; |
501 | 176 } |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
84
diff
changeset
|
177 |
501 | 178 if (rv == NGX_CONF_ERROR) { |
1123
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
179 goto failed; |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
180 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
181 |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
182 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, rv); |
1123
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
183 |
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
184 goto failed; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
185 } |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
186 |
501 | 187 |
188 rc = ngx_conf_handler(cf, rc); | |
189 | |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
190 if (rc == NGX_ERROR) { |
1123
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
191 goto failed; |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
192 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
193 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
194 |
1123
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
195 failed: |
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
196 |
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
197 rc = NGX_ERROR; |
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
198 |
88dc269bbca2
use "goto" instead of indistinct "break"
Igor Sysoev <igor@sysoev.ru>
parents:
1122
diff
changeset
|
199 done: |
501 | 200 |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
201 if (filename) { |
629 | 202 ngx_free(cf->conf_file->buffer->start); |
583 | 203 |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
204 cf->conf_file = prev; |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
205 |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
206 if (ngx_close_file(fd) == NGX_FILE_ERROR) { |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
207 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
208 ngx_close_file_n " %s failed", |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
209 cf->conf_file->file.name.data); |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
210 return NGX_CONF_ERROR; |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
211 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
212 } |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
213 |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
214 if (rc == NGX_ERROR) { |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
215 return NGX_CONF_ERROR; |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
216 } |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
217 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
218 return NGX_CONF_OK; |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
219 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
220 |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
221 |
503 | 222 static ngx_int_t |
223 ngx_conf_handler(ngx_conf_t *cf, ngx_int_t last) | |
501 | 224 { |
225 char *rv; | |
226 void *conf, **confp; | |
645 | 227 ngx_uint_t i, multi; |
501 | 228 ngx_str_t *name; |
229 ngx_command_t *cmd; | |
230 | |
231 name = cf->args->elts; | |
232 | |
645 | 233 multi = 0; |
234 | |
501 | 235 for (i = 0; ngx_modules[i]; i++) { |
236 | |
237 /* look up the directive in the appropriate modules */ | |
238 | |
239 if (ngx_modules[i]->type != NGX_CONF_MODULE | |
240 && ngx_modules[i]->type != cf->module_type) | |
241 { | |
242 continue; | |
243 } | |
244 | |
245 cmd = ngx_modules[i]->commands; | |
246 if (cmd == NULL) { | |
247 continue; | |
248 } | |
249 | |
645 | 250 for ( /* void */ ; cmd->name.len; cmd++) { |
501 | 251 |
645 | 252 if (name->len != cmd->name.len) { |
253 continue; | |
254 } | |
501 | 255 |
645 | 256 if (ngx_strcmp(name->data, cmd->name.data) != 0) { |
257 continue; | |
258 } | |
259 | |
260 | |
261 /* is the directive's location right ? */ | |
262 | |
263 if (!(cmd->type & cf->cmd_type)) { | |
264 if (cmd->type & NGX_CONF_MULTI) { | |
265 multi = 1; | |
266 continue; | |
501 | 267 } |
268 | |
645 | 269 goto not_allowed; |
270 } | |
271 | |
272 if (!(cmd->type & NGX_CONF_BLOCK) && last != NGX_OK) { | |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
273 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
274 "directive \"%s\" is not terminated by \";\"", |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
275 name->data); |
645 | 276 return NGX_ERROR; |
277 } | |
501 | 278 |
645 | 279 if ((cmd->type & NGX_CONF_BLOCK) && last != NGX_CONF_BLOCK_START) { |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
280 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
281 "directive \"%s\" has no opening \"{\"", |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
282 name->data); |
645 | 283 return NGX_ERROR; |
284 } | |
501 | 285 |
645 | 286 /* is the directive's argument count right ? */ |
501 | 287 |
645 | 288 if (!(cmd->type & NGX_CONF_ANY)) { |
501 | 289 |
645 | 290 if (cmd->type & NGX_CONF_FLAG) { |
501 | 291 |
645 | 292 if (cf->args->nelts != 2) { |
293 goto invalid; | |
501 | 294 } |
295 | |
296 } else if (cmd->type & NGX_CONF_1MORE) { | |
297 | |
645 | 298 if (cf->args->nelts < 2) { |
299 goto invalid; | |
501 | 300 } |
301 | |
302 } else if (cmd->type & NGX_CONF_2MORE) { | |
303 | |
645 | 304 if (cf->args->nelts < 3) { |
305 goto invalid; | |
501 | 306 } |
307 | |
645 | 308 } else if (cf->args->nelts > NGX_CONF_MAX_ARGS) { |
501 | 309 |
645 | 310 goto invalid; |
501 | 311 |
645 | 312 } else if (!(cmd->type & argument_number[cf->args->nelts - 1])) |
313 { | |
314 goto invalid; | |
501 | 315 } |
645 | 316 } |
501 | 317 |
645 | 318 /* set up the directive's configuration context */ |
501 | 319 |
645 | 320 conf = NULL; |
501 | 321 |
645 | 322 if (cmd->type & NGX_DIRECT_CONF) { |
323 conf = ((void **) cf->ctx)[ngx_modules[i]->index]; | |
501 | 324 |
645 | 325 } else if (cmd->type & NGX_MAIN_CONF) { |
326 conf = &(((void **) cf->ctx)[ngx_modules[i]->index]); | |
501 | 327 |
645 | 328 } else if (cf->ctx) { |
329 confp = *(void **) ((char *) cf->ctx + cmd->conf); | |
501 | 330 |
645 | 331 if (confp) { |
332 conf = confp[ngx_modules[i]->ctx_index]; | |
501 | 333 } |
645 | 334 } |
501 | 335 |
645 | 336 rv = cmd->set(cf, cmd, conf); |
501 | 337 |
645 | 338 if (rv == NGX_CONF_OK) { |
339 return NGX_OK; | |
340 } | |
341 | |
342 if (rv == NGX_CONF_ERROR) { | |
501 | 343 return NGX_ERROR; |
344 } | |
345 | |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
346 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
1237 | 347 "\"%s\" directive %s", name->data, rv); |
645 | 348 |
349 return NGX_ERROR; | |
501 | 350 } |
351 } | |
352 | |
645 | 353 if (multi == 0) { |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
354 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
355 "unknown directive \"%s\"", name->data); |
645 | 356 |
357 return NGX_ERROR; | |
358 } | |
359 | |
360 not_allowed: | |
361 | |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
362 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
1237 | 363 "\"%s\" directive is not allowed here", name->data); |
645 | 364 return NGX_ERROR; |
365 | |
366 invalid: | |
367 | |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
368 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
1237 | 369 "invalid number arguments in \"%s\" directive", |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
370 name->data); |
501 | 371 |
372 return NGX_ERROR; | |
373 } | |
374 | |
375 | |
503 | 376 static ngx_int_t |
377 ngx_conf_read_token(ngx_conf_t *cf) | |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
378 { |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
379 u_char *start, ch, *src, *dst; |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
380 int len; |
509 | 381 int found, need_space, last_space, sharp_comment, variable; |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
382 int quoted, s_quoted, d_quoted; |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
383 ssize_t n; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
384 ngx_str_t *word; |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
385 ngx_buf_t *b; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
386 |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
387 found = 0; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
388 need_space = 0; |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
389 last_space = 1; |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
390 sharp_comment = 0; |
509 | 391 variable = 0; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
392 quoted = s_quoted = d_quoted = 0; |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
393 |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
394 cf->args->nelts = 0; |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
395 b = cf->conf_file->buffer; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
396 start = b->pos; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
397 |
37
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
398 for ( ;; ) { |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
399 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
400 if (b->pos >= b->last) { |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
401 if (cf->conf_file->file.offset |
487 | 402 >= ngx_file_size(&cf->conf_file->file.info)) |
403 { | |
404 if (cf->args->nelts > 0) { | |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
405 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
406 "unexpected end of file, " |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
407 "expecting \";\" or \"}\""); |
487 | 408 return NGX_ERROR; |
409 } | |
410 | |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
411 return NGX_CONF_FILE_DONE; |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
412 } |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
413 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
414 if (b->pos - start) { |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
415 ngx_memcpy(b->start, start, b->pos - start); |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
416 } |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
417 |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
418 n = ngx_read_file(&cf->conf_file->file, |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
419 b->start + (b->pos - start), |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
420 b->end - (b->start + (b->pos - start)), |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
421 cf->conf_file->file.offset); |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
422 |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
423 if (n == NGX_ERROR) { |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
424 return NGX_ERROR; |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
425 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
426 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
427 b->pos = b->start + (b->pos - start); |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
428 start = b->start; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
429 b->last = b->pos + n; |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
430 } |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
431 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
432 ch = *b->pos++; |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
433 |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
434 if (ch == LF) { |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
435 cf->conf_file->line++; |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
436 |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
437 if (sharp_comment) { |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
438 sharp_comment = 0; |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
439 } |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
440 } |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
441 |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
442 if (sharp_comment) { |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
443 continue; |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
444 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
445 |
37
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
446 if (quoted) { |
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
447 quoted = 0; |
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
448 continue; |
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
449 } |
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
450 |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
451 if (need_space) { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
452 if (ch == ' ' || ch == '\t' || ch == CR || ch == LF) { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
453 last_space = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
454 need_space = 0; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
455 continue; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
456 } |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
457 |
461 | 458 if (ch == ';') { |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
459 return NGX_OK; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
460 } |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
461 |
461 | 462 if (ch == '{') { |
463 return NGX_CONF_BLOCK_START; | |
464 } | |
465 | |
581 | 466 if (ch == ')') { |
467 last_space = 1; | |
468 need_space = 0; | |
177
4db54fdbcbe7
nginx-0.0.1-2003-11-10-20:17:31 import
Igor Sysoev <igor@sysoev.ru>
parents:
176
diff
changeset
|
469 |
581 | 470 } else { |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
471 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
472 "unexpected \"%c\"", ch); |
581 | 473 return NGX_ERROR; |
474 } | |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
475 } |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
476 |
32
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
477 if (last_space) { |
d45effe5854c
nginx-0.0.1-2002-12-19-10:08:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
478 if (ch == ' ' || ch == '\t' || ch == CR || ch == LF) { |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
479 continue; |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
480 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
481 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
482 start = b->pos - 1; |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
483 |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
484 switch (ch) { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
485 |
37
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
486 case ';': |
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
487 case '{': |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
488 if (cf->args->nelts == 0) { |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
489 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
490 "unexpected \"%c\"", ch); |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
491 return NGX_ERROR; |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
492 } |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
493 |
461 | 494 if (ch == '{') { |
495 return NGX_CONF_BLOCK_START; | |
496 } | |
497 | |
37
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
498 return NGX_OK; |
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
499 |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
500 case '}': |
517 | 501 if (cf->args->nelts != 0) { |
1124
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
502 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
f1a8c6cd10ba
ngx_log_error() > ngx_conf_log_error()
Igor Sysoev <igor@sysoev.ru>
parents:
1123
diff
changeset
|
503 "unexpected \"}\""); |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
504 return NGX_ERROR; |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
505 } |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
506 |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
507 return NGX_CONF_BLOCK_DONE; |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
508 |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
509 case '#': |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
510 sharp_comment = 1; |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
511 continue; |
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
512 |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
513 case '\\': |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
514 quoted = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
515 last_space = 0; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
516 continue; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
517 |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
518 case '"': |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
519 start++; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
520 d_quoted = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
521 last_space = 0; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
522 continue; |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
523 |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
524 case '\'': |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
525 start++; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
526 s_quoted = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
527 last_space = 0; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
528 continue; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
529 |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
530 default: |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
531 last_space = 0; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
532 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
533 |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
534 } else { |
509 | 535 if (ch == '{' && variable) { |
536 continue; | |
537 } | |
538 | |
539 variable = 0; | |
540 | |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
541 if (ch == '\\') { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
542 quoted = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
543 continue; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
544 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
545 |
509 | 546 if (ch == '$') { |
547 variable = 1; | |
548 continue; | |
549 } | |
550 | |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
551 if (d_quoted) { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
552 if (ch == '"') { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
553 d_quoted = 0; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
554 need_space = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
555 found = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
556 } |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
557 |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
558 } else if (s_quoted) { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
559 if (ch == '\'') { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
560 s_quoted = 0; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
561 need_space = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
562 found = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
563 } |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
564 |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
565 } else if (ch == ' ' || ch == '\t' || ch == CR || ch == LF |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
566 || ch == ';' || ch == '{') { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
567 last_space = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
568 found = 1; |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
569 } |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
570 |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
571 if (found) { |
501 | 572 word = ngx_array_push(cf->args); |
573 if (word == NULL) { | |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
574 return NGX_ERROR; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
575 } |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
576 |
501 | 577 word->data = ngx_palloc(cf->pool, b->pos - start + 1); |
578 if (word->data == NULL) { | |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
579 return NGX_ERROR; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
580 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
581 |
37
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
582 for (dst = word->data, src = start, len = 0; |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
583 src < b->pos - 1; |
37
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
584 len++) |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
585 { |
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
586 if (*src == '\\') { |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
587 switch (src[1]) { |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
588 case '"': |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
589 case '\'': |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
590 case '\\': |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
591 src++; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
592 break; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
593 |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
594 case 't': |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
595 *dst++ = '\t'; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
596 src += 2; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
597 continue; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
598 |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
599 case 'r': |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
600 *dst++ = '\r'; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
601 src += 2; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
602 continue; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
603 |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
604 case 'n': |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
605 *dst++ = '\n'; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
606 src += 2; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
607 continue; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
608 } |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
609 |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
610 } |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
611 *dst++ = *src++; |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
612 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
613 *dst = '\0'; |
37
9fe40e51d4a3
nginx-0.0.1-2002-12-23-21:22:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
36
diff
changeset
|
614 word->len = len; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
615 |
461 | 616 if (ch == ';') { |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
617 return NGX_OK; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
618 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
619 |
461 | 620 if (ch == '{') { |
621 return NGX_CONF_BLOCK_START; | |
622 } | |
623 | |
36
c14d7232b11f
nginx-0.0.1-2002-12-23-09:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
35
diff
changeset
|
624 found = 0; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
625 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
626 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
627 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
628 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
629 |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
630 |
503 | 631 static char * |
632 ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
633 { |
727 | 634 char *rv; |
635 ngx_int_t n; | |
636 ngx_str_t *value, file; | |
637 ngx_glob_t gl; | |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
638 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
639 value = cf->args->elts; |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
640 file = value[1]; |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
641 |
727 | 642 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); |
643 | |
563 | 644 if (ngx_conf_full_name(cf->cycle, &file) == NGX_ERROR) { |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
645 return NGX_CONF_ERROR; |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
646 } |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
647 |
727 | 648 ngx_memzero(&gl, sizeof(ngx_glob_t)); |
649 | |
650 gl.pattern = file.data; | |
651 gl.log = cf->log; | |
652 | |
653 if (ngx_open_glob(&gl) != NGX_OK) { | |
654 ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno, | |
655 ngx_open_glob_n " \"%s\" failed", file.data); | |
656 return NGX_CONF_ERROR; | |
657 } | |
658 | |
659 rv = NGX_CONF_OK; | |
660 | |
661 for ( ;; ) { | |
662 n = ngx_read_glob(&gl, &file); | |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
663 |
727 | 664 if (n != NGX_OK) { |
665 break; | |
666 } | |
667 | |
668 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); | |
669 | |
670 rv = ngx_conf_parse(cf, &file); | |
671 | |
672 if (rv != NGX_CONF_OK) { | |
673 break; | |
674 } | |
675 } | |
676 | |
677 ngx_close_glob(&gl); | |
678 | |
679 return rv; | |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
680 } |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
681 |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
314
diff
changeset
|
682 |
503 | 683 ngx_int_t |
684 ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name) | |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
685 { |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
686 u_char *p; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
687 ngx_str_t old; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
688 |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
689 if (name->data[0] == '/') { |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
690 return NGX_OK; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
691 } |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
692 |
461 | 693 #if (NGX_WIN32) |
694 | |
695 if (name->len > 2 | |
696 && name->data[1] == ':' | |
697 && ((name->data[0] >= 'a' && name->data[0] <= 'z') | |
698 || (name->data[0] >= 'A' && name->data[0] <= 'Z'))) | |
699 { | |
700 return NGX_OK; | |
701 } | |
702 | |
703 #endif | |
704 | |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
705 old = *name; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
706 |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
707 name->len = cycle->root.len + old.len; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
708 |
605 | 709 name->data = ngx_palloc(cycle->pool, name->len + 1); |
710 if (name->data == NULL) { | |
711 return NGX_ERROR; | |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
712 } |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
713 |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
714 p = ngx_cpymem(name->data, cycle->root.data, cycle->root.len), |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
715 ngx_cpystrn(p, old.data, old.len + 1); |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
716 |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
717 return NGX_OK; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
718 } |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
719 |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
720 |
503 | 721 ngx_open_file_t * |
722 ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) | |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
723 { |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
724 ngx_str_t full; |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
725 ngx_uint_t i; |
414
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
726 ngx_list_part_t *part; |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
727 ngx_open_file_t *file; |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
728 |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
447
diff
changeset
|
729 #if (NGX_SUPPRESS_WARN) |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
447
diff
changeset
|
730 full.len = 0; |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
447
diff
changeset
|
731 full.data = NULL; |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
447
diff
changeset
|
732 #endif |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
447
diff
changeset
|
733 |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
734 if (name) { |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
735 full = *name; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
736 |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
737 if (ngx_conf_full_name(cycle, &full) == NGX_ERROR) { |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
738 return NULL; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
739 } |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
740 |
414
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
741 part = &cycle->open_files.part; |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
742 file = part->elts; |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
743 |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
744 for (i = 0; /* void */ ; i++) { |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
745 |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
746 if (i >= part->nelts) { |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
747 if (part->next == NULL) { |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
748 break; |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
749 } |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
750 part = part->next; |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
751 file = part->elts; |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
752 i = 0; |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
753 } |
388a842cbbe1
nginx-0.0.10-2004-09-03-19:50:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
412
diff
changeset
|
754 |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
755 if (full.len != file[i].name.len) { |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
756 continue; |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
757 } |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
758 |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
759 if (ngx_strcmp(full.data, file[i].name.data) == 0) { |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
760 return &file[i]; |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
761 } |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
762 } |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
763 } |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
764 |
501 | 765 file = ngx_list_push(&cycle->open_files); |
766 if (file == NULL) { | |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
767 return NULL; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
768 } |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
769 |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
770 if (name) { |
447
288f249897e7
nginx-0.1.0-2004-09-30-23:44:38 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
771 file->fd = NGX_INVALID_FILE; |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
772 file->name = full; |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
773 |
415
3c56e834be46
nginx-0.0.10-2004-09-05-23:54:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
414
diff
changeset
|
774 } else { |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
447
diff
changeset
|
775 file->fd = ngx_stderr_fileno; |
415
3c56e834be46
nginx-0.0.10-2004-09-05-23:54:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
414
diff
changeset
|
776 file->name.len = 0; |
3c56e834be46
nginx-0.0.10-2004-09-05-23:54:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
414
diff
changeset
|
777 file->name.data = NULL; |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
778 } |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
779 |
571 | 780 file->buffer = NULL; |
781 | |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
782 return file; |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
783 } |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
784 |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
785 |
571 | 786 static void |
787 ngx_conf_flush_files(ngx_cycle_t *cycle) | |
788 { | |
789 ngx_uint_t i; | |
790 ngx_list_part_t *part; | |
791 ngx_open_file_t *file; | |
792 | |
793 ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0, "flush files"); | |
794 | |
795 part = &cycle->open_files.part; | |
796 file = part->elts; | |
797 | |
798 for (i = 0; /* void */ ; i++) { | |
799 | |
800 if (i >= part->nelts) { | |
801 if (part->next == NULL) { | |
802 break; | |
803 } | |
804 part = part->next; | |
805 file = part->elts; | |
806 i = 0; | |
807 } | |
808 | |
809 if (file[i].buffer == NULL || file[i].pos - file[i].buffer == 0) { | |
810 continue; | |
811 } | |
812 | |
813 ngx_write_fd(file[i].fd, file[i].buffer, file[i].pos - file[i].buffer); | |
814 } | |
815 } | |
816 | |
817 | |
503 | 818 void ngx_cdecl |
819 ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err, | |
820 char *fmt, ...) | |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
821 { |
461 | 822 u_char errstr[NGX_MAX_CONF_ERRSTR], *buf, *last; |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
823 va_list args; |
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
824 |
461 | 825 last = errstr + NGX_MAX_CONF_ERRSTR; |
826 | |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
827 va_start(args, fmt); |
461 | 828 buf = ngx_vsnprintf(errstr, last - errstr, fmt, args); |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
829 va_end(args); |
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
830 |
461 | 831 *buf = '\0'; |
832 | |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
833 if (err) { |
461 | 834 buf = ngx_snprintf(buf, last - buf - 1, " (%d: ", err); |
835 buf = ngx_strerror_r(err, buf, last - buf - 1); | |
836 *buf++ = ')'; | |
837 *buf = '\0'; | |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
838 } |
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
839 |
593 | 840 if (cf->conf_file == NULL) { |
841 ngx_log_error(level, cf->log, 0, "%s", errstr); | |
842 return; | |
843 } | |
844 | |
507 | 845 ngx_log_error(level, cf->log, 0, "%s in %s:%ui", |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
846 errstr, cf->conf_file->file.name.data, cf->conf_file->line); |
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
847 } |
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
848 |
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
117
diff
changeset
|
849 |
503 | 850 char * |
851 ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
852 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
853 char *p = conf; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
854 |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
855 ngx_str_t *value; |
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
856 ngx_flag_t *fp; |
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
857 ngx_conf_post_t *post; |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
858 |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
859 fp = (ngx_flag_t *) (p + cmd->offset); |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
860 |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
861 if (*fp != NGX_CONF_UNSET) { |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
862 return "is duplicate"; |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
863 } |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
864 |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
865 value = cf->args->elts; |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
866 |
1107
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1048
diff
changeset
|
867 if (ngx_strcasecmp(value[1].data, (u_char *) "on") == 0) { |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
868 *fp = 1; |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
869 |
1107
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1048
diff
changeset
|
870 } else if (ngx_strcasecmp(value[1].data, (u_char *) "off") == 0) { |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
871 *fp = 0; |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
872 |
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
873 } else { |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
874 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
875 "invalid value \"%s\" in \"%s\" directive, " |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
876 "it must be \"on\" or \"off\"", |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
877 value[1].data, cmd->name.data); |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
878 return NGX_CONF_ERROR; |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
879 } |
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
880 |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
881 if (cmd->post) { |
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
882 post = cmd->post; |
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
883 return post->post_handler(cf, post, fp); |
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
884 } |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
885 |
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
886 return NGX_CONF_OK; |
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
887 } |
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
888 |
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
889 |
503 | 890 char * |
891 ngx_conf_set_str_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
892 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
893 char *p = conf; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
894 |
412
199cd29f35a3
nginx-0.0.10-2004-08-31-19:32:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
895 ngx_str_t *field, *value; |
199cd29f35a3
nginx-0.0.10-2004-08-31-19:32:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
896 ngx_conf_post_t *post; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
897 |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
898 field = (ngx_str_t *) (p + cmd->offset); |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
899 |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
900 if (field->data) { |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
901 return "is duplicate"; |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
902 } |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
903 |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
904 value = cf->args->elts; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
905 |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
141
diff
changeset
|
906 *field = value[1]; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
907 |
412
199cd29f35a3
nginx-0.0.10-2004-08-31-19:32:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
908 if (cmd->post) { |
199cd29f35a3
nginx-0.0.10-2004-08-31-19:32:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
909 post = cmd->post; |
199cd29f35a3
nginx-0.0.10-2004-08-31-19:32:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
910 return post->post_handler(cf, post, field); |
199cd29f35a3
nginx-0.0.10-2004-08-31-19:32:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
911 } |
199cd29f35a3
nginx-0.0.10-2004-08-31-19:32:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
912 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
913 return NGX_CONF_OK; |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
914 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
915 |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
916 |
503 | 917 char * |
649 | 918 ngx_conf_set_str_array_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
509 | 919 { |
920 char *p = conf; | |
921 | |
649 | 922 ngx_str_t *value, *s; |
509 | 923 ngx_array_t **a; |
924 ngx_conf_post_t *post; | |
925 | |
926 a = (ngx_array_t **) (p + cmd->offset); | |
927 | |
928 if (*a == NULL) { | |
649 | 929 *a = ngx_array_create(cf->pool, 4, sizeof(ngx_str_t)); |
509 | 930 if (*a == NULL) { |
931 return NGX_CONF_ERROR; | |
932 } | |
933 } | |
934 | |
649 | 935 s = ngx_array_push(*a); |
936 if (s == NULL) { | |
509 | 937 return NGX_CONF_ERROR; |
938 } | |
939 | |
940 value = cf->args->elts; | |
941 | |
649 | 942 *s = value[1]; |
509 | 943 |
944 if (cmd->post) { | |
945 post = cmd->post; | |
649 | 946 return post->post_handler(cf, post, s); |
947 } | |
948 | |
949 return NGX_CONF_OK; | |
950 } | |
951 | |
952 | |
953 char * | |
954 ngx_conf_set_keyval_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
955 { | |
956 char *p = conf; | |
957 | |
958 ngx_str_t *value; | |
959 ngx_array_t **a; | |
960 ngx_keyval_t *kv; | |
961 ngx_conf_post_t *post; | |
962 | |
963 a = (ngx_array_t **) (p + cmd->offset); | |
964 | |
965 if (*a == NULL) { | |
966 *a = ngx_array_create(cf->pool, 4, sizeof(ngx_keyval_t)); | |
967 if (*a == NULL) { | |
968 return NGX_CONF_ERROR; | |
969 } | |
970 } | |
971 | |
972 kv = ngx_array_push(*a); | |
973 if (kv == NULL) { | |
974 return NGX_CONF_ERROR; | |
975 } | |
976 | |
977 value = cf->args->elts; | |
978 | |
979 kv->key = value[1]; | |
980 kv->value = value[2]; | |
981 | |
982 if (cmd->post) { | |
983 post = cmd->post; | |
984 return post->post_handler(cf, post, kv); | |
509 | 985 } |
986 | |
987 return NGX_CONF_OK; | |
988 } | |
989 | |
990 | |
991 char * | |
503 | 992 ngx_conf_set_num_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
993 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
994 char *p = conf; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
995 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
996 ngx_int_t *np; |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
997 ngx_str_t *value; |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
998 ngx_conf_post_t *post; |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
999 |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1000 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1001 np = (ngx_int_t *) (p + cmd->offset); |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1002 |
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1003 if (*np != NGX_CONF_UNSET) { |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1004 return "is duplicate"; |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1005 } |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1006 |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1007 value = cf->args->elts; |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1008 *np = ngx_atoi(value[1].data, value[1].len); |
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1009 if (*np == NGX_ERROR) { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
1010 return "invalid number"; |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
1011 } |
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
1012 |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1013 if (cmd->post) { |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1014 post = cmd->post; |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1015 return post->post_handler(cf, post, np); |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1016 } |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
1017 |
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
1018 return NGX_CONF_OK; |
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
1019 } |
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
1020 |
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
1021 |
503 | 1022 char * |
1023 ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
1024 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
1025 char *p = conf; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
1026 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
1027 size_t *sp; |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1028 ngx_str_t *value; |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1029 ngx_conf_post_t *post; |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
1030 |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1031 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
1032 sp = (size_t *) (p + cmd->offset); |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
1033 if (*sp != NGX_CONF_UNSET_SIZE) { |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1034 return "is duplicate"; |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1035 } |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1036 |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1037 value = cf->args->elts; |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
1038 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1039 *sp = ngx_parse_size(&value[1]); |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
1040 if (*sp == (size_t) NGX_ERROR) { |
84
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1041 return "invalid value"; |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
1042 } |
10
4f3879d9b6f6
nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1043 |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1044 if (cmd->post) { |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1045 post = cmd->post; |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1046 return post->post_handler(cf, post, sp); |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1047 } |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
1048 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
1049 return NGX_CONF_OK; |
10
4f3879d9b6f6
nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1050 } |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
10
diff
changeset
|
1051 |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
1052 |
503 | 1053 char * |
663 | 1054 ngx_conf_set_off_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
1055 { | |
1056 char *p = conf; | |
1057 | |
1058 off_t *op; | |
1059 ngx_str_t *value; | |
1060 ngx_conf_post_t *post; | |
1061 | |
1062 | |
1063 op = (off_t *) (p + cmd->offset); | |
1064 if (*op != NGX_CONF_UNSET) { | |
1065 return "is duplicate"; | |
1066 } | |
1067 | |
1068 value = cf->args->elts; | |
1069 | |
1070 *op = ngx_parse_offset(&value[1]); | |
1071 if (*op == (off_t) NGX_ERROR) { | |
1072 return "invalid value"; | |
1073 } | |
1074 | |
1075 if (cmd->post) { | |
1076 post = cmd->post; | |
1077 return post->post_handler(cf, post, op); | |
1078 } | |
1079 | |
1080 return NGX_CONF_OK; | |
1081 } | |
1082 | |
1083 | |
1084 char * | |
503 | 1085 ngx_conf_set_msec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
10
diff
changeset
|
1086 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
1087 char *p = conf; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
1088 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1089 ngx_msec_t *msp; |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1090 ngx_str_t *value; |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1091 ngx_conf_post_t *post; |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
10
diff
changeset
|
1092 |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1093 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1094 msp = (ngx_msec_t *) (p + cmd->offset); |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
1095 if (*msp != NGX_CONF_UNSET_MSEC) { |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1096 return "is duplicate"; |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1097 } |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1098 |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1099 value = cf->args->elts; |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
1100 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1101 *msp = ngx_parse_time(&value[1], 0); |
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1102 if (*msp == (ngx_msec_t) NGX_ERROR) { |
157
70b36c805682
nginx-0.0.1-2003-10-23-19:54:19 import
Igor Sysoev <igor@sysoev.ru>
parents:
156
diff
changeset
|
1103 return "invalid value"; |
83
a7e45c45a95c
nginx-0.0.1-2003-04-28-19:06:39 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
1104 } |
a7e45c45a95c
nginx-0.0.1-2003-04-28-19:06:39 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
1105 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1106 if (*msp == (ngx_msec_t) NGX_PARSE_LARGE_TIME) { |
157
70b36c805682
nginx-0.0.1-2003-10-23-19:54:19 import
Igor Sysoev <igor@sysoev.ru>
parents:
156
diff
changeset
|
1107 return "value must be less than 597 hours"; |
70b36c805682
nginx-0.0.1-2003-10-23-19:54:19 import
Igor Sysoev <igor@sysoev.ru>
parents:
156
diff
changeset
|
1108 } |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1109 |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1110 if (cmd->post) { |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1111 post = cmd->post; |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1112 return post->post_handler(cf, post, msp); |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1113 } |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
37
diff
changeset
|
1114 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
1115 return NGX_CONF_OK; |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
10
diff
changeset
|
1116 } |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
1117 |
84
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1118 |
503 | 1119 char * |
1120 ngx_conf_set_sec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
84
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1121 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
1122 char *p = conf; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
1123 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1124 time_t *sp; |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1125 ngx_str_t *value; |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1126 ngx_conf_post_t *post; |
84
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1127 |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1128 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1129 sp = (time_t *) (p + cmd->offset); |
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1130 if (*sp != NGX_CONF_UNSET) { |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1131 return "is duplicate"; |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1132 } |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
1133 |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1134 value = cf->args->elts; |
84
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1135 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1136 *sp = ngx_parse_time(&value[1], 1); |
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1137 if (*sp == NGX_ERROR) { |
157
70b36c805682
nginx-0.0.1-2003-10-23-19:54:19 import
Igor Sysoev <igor@sysoev.ru>
parents:
156
diff
changeset
|
1138 return "invalid value"; |
84
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1139 } |
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1140 |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1141 if (*sp == NGX_PARSE_LARGE_TIME) { |
157
70b36c805682
nginx-0.0.1-2003-10-23-19:54:19 import
Igor Sysoev <igor@sysoev.ru>
parents:
156
diff
changeset
|
1142 return "value must be less than 68 years"; |
70b36c805682
nginx-0.0.1-2003-10-23-19:54:19 import
Igor Sysoev <igor@sysoev.ru>
parents:
156
diff
changeset
|
1143 } |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1144 |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1145 if (cmd->post) { |
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
157
diff
changeset
|
1146 post = cmd->post; |
265
6468241715e6
nginx-0.0.2-2004-02-20-19:48:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
257
diff
changeset
|
1147 return post->post_handler(cf, post, sp); |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1148 } |
84
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1149 |
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1150 return NGX_CONF_OK; |
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1151 } |
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1152 |
fab4cb00fe5b
nginx-0.0.1-2003-05-06-21:03:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
1153 |
503 | 1154 char * |
1155 ngx_conf_set_bufs_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
141
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1156 { |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1157 char *p = conf; |
141
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1158 |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1159 ngx_str_t *value; |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1160 ngx_bufs_t *bufs; |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1161 |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1162 |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1163 bufs = (ngx_bufs_t *) (p + cmd->offset); |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1164 if (bufs->num) { |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1165 return "is duplicate"; |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1166 } |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1167 |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1168 value = cf->args->elts; |
141
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1169 |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1170 bufs->num = ngx_atoi(value[1].data, value[1].len); |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1171 if (bufs->num == NGX_ERROR || bufs->num == 0) { |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1172 return "invalid value"; |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1173 } |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1174 |
157
70b36c805682
nginx-0.0.1-2003-10-23-19:54:19 import
Igor Sysoev <igor@sysoev.ru>
parents:
156
diff
changeset
|
1175 bufs->size = ngx_parse_size(&value[2]); |
167
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
1176 if (bufs->size == (size_t) NGX_ERROR || bufs->size == 0) { |
141
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1177 return "invalid value"; |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1178 } |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1179 |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1180 return NGX_CONF_OK; |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1181 } |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1182 |
656d468f4ead
nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
1183 |
503 | 1184 char * |
1185 ngx_conf_set_enum_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1186 { |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1187 char *p = conf; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1188 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1189 ngx_uint_t *np, i; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1190 ngx_str_t *value; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1191 ngx_conf_enum_t *e; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1192 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1193 np = (ngx_uint_t *) (p + cmd->offset); |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1194 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1195 if (*np != NGX_CONF_UNSET_UINT) { |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1196 return "is duplicate"; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1197 } |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1198 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1199 value = cf->args->elts; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1200 e = cmd->post; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1201 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1202 for (i = 0; e[i].name.len != 0; i++) { |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1203 if (e[i].name.len != value[1].len |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1204 || ngx_strcasecmp(e[i].name.data, value[1].data) != 0) |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1205 { |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1206 continue; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1207 } |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1208 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1209 *np = e[i].value; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1210 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1211 return NGX_CONF_OK; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1212 } |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1213 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1214 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1215 "invalid value \"%s\"", value[1].data); |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1216 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1217 return NGX_CONF_ERROR; |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1218 } |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1219 |
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1220 |
503 | 1221 char * |
1222 ngx_conf_set_bitmask_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1223 { |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1224 char *p = conf; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1225 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
1226 ngx_uint_t *np, i, m; |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1227 ngx_str_t *value; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1228 ngx_conf_bitmask_t *mask; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1229 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1230 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
265
diff
changeset
|
1231 np = (ngx_uint_t *) (p + cmd->offset); |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1232 value = cf->args->elts; |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1233 mask = cmd->post; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1234 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1235 for (i = 1; i < cf->args->nelts; i++) { |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1236 for (m = 0; mask[m].name.len != 0; m++) { |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1237 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1238 if (mask[m].name.len != value[i].len |
314
d71c87d11b16
nginx-0.0.3-2004-04-14-09:57:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
311
diff
changeset
|
1239 || ngx_strcasecmp(mask[m].name.data, value[i].data) != 0) |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1240 { |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1241 continue; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1242 } |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1243 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1244 if (*np & mask[m].mask) { |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1245 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1246 "duplicate value \"%s\"", value[i].data); |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1247 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1248 } else { |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1249 *np |= mask[m].mask; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1250 } |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1251 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1252 break; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1253 } |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1254 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1255 if (mask[m].name.len == 0) { |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1256 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1257 "invalid value \"%s\"", value[i].data); |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1258 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1259 return NGX_CONF_ERROR; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1260 } |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1261 } |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1262 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1263 return NGX_CONF_OK; |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1264 } |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1265 |
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
1266 |
503 | 1267 char * |
1268 ngx_conf_unsupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
1269 { |
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
1270 return "unsupported on this platform"; |
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
1271 } |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1272 |
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1273 |
503 | 1274 char * |
581 | 1275 ngx_conf_deprecated(ngx_conf_t *cf, void *post, void *data) |
1276 { | |
1277 ngx_conf_deprecated_t *d = post; | |
1278 | |
1279 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
1280 "the \"%s\" directive is deprecated, " | |
1281 "use the \"%s\" directive instead", | |
1282 d->old_name, d->new_name); | |
1283 | |
1284 return NGX_CONF_OK; | |
1285 } | |
1286 | |
1287 | |
1288 char * | |
503 | 1289 ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data) |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1290 { |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
1291 ngx_conf_num_bounds_t *bounds = post; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
337
diff
changeset
|
1292 ngx_int_t *np = data; |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1293 |
172
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1294 if (bounds->high == -1) { |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1295 if (*np >= bounds->low) { |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1296 return NGX_CONF_OK; |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1297 } |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1298 |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1299 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
507 | 1300 "value must be equal or more than %i", bounds->low); |
172
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1301 |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1302 return NGX_CONF_ERROR; |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1303 } |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1304 |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1305 if (*np >= bounds->low && *np <= bounds->high) { |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1306 return NGX_CONF_OK; |
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1307 } |
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1308 |
172
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1309 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
507 | 1310 "value must be between %i and %i", |
172
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1311 bounds->low, bounds->high); |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1312 |
caa57ddf6d77
nginx-0.0.1-2003-11-04-01:20:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
167
diff
changeset
|
1313 return NGX_CONF_ERROR; |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
1314 } |