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