comparison src/core/ngx_conf_file.c @ 2064:0835142149d2

refactor obscure code
author Igor Sysoev <igor@sysoev.ru>
date Wed, 25 Jun 2008 14:56:14 +0000
parents 2a92804f4109
children 01b71aa095cc
comparison
equal deleted inserted replaced
2063:67a29af877ed 2064:0835142149d2
143 if (rc == NGX_ERROR) { 143 if (rc == NGX_ERROR) {
144 goto done; 144 goto done;
145 } 145 }
146 146
147 if (rc == NGX_CONF_BLOCK_DONE) { 147 if (rc == NGX_CONF_BLOCK_DONE) {
148
148 if (!block) { 149 if (!block) {
149 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "unexpected \"}\""); 150 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "unexpected \"}\"");
150 goto failed; 151 goto failed;
151 } 152 }
152 153
153 block = 0;
154 }
155
156 if (rc == NGX_CONF_FILE_DONE && block) {
157 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
158 "unexpected end of file, expecting \"}\"");
159 goto failed;
160 }
161
162 if (rc != NGX_OK && rc != NGX_CONF_BLOCK_START) {
163 goto done; 154 goto done;
164 } 155 }
156
157 if (rc == NGX_CONF_FILE_DONE) {
158
159 if (block) {
160 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
161 "unexpected end of file, expecting \"}\"");
162 goto failed;
163 }
164
165 goto done;
166 }
167
168 /* rc == NGX_OK || rc == NGX_CONF_BLOCK_START */
165 169
166 if (cf->handler) { 170 if (cf->handler) {
167 171
168 /* 172 /*
169 * the custom handler, i.e., that is used in the http's 173 * the custom handler, i.e., that is used in the http's