}
if (rc == NGX_CONF_BLOCK_DONE) {
+
if (!block) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "unexpected \"}\"");
goto failed;
}
- block = 0;
+ goto done;
}
- if (rc == NGX_CONF_FILE_DONE && block) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "unexpected end of file, expecting \"}\"");
- goto failed;
- }
+ if (rc == NGX_CONF_FILE_DONE) {
+
+ if (block) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "unexpected end of file, expecting \"}\"");
+ goto failed;
+ }
- if (rc != NGX_OK && rc != NGX_CONF_BLOCK_START) {
goto done;
}
+ /* rc == NGX_OK || rc == NGX_CONF_BLOCK_START */
+
if (cf->handler) {
/*