Welcome! Log In Create A New Profile

Advanced

[nginx] Core: strengthen configuration syntax checker.

Valentin Bartenev
May 23, 2013 12:34PM
details: http://hg.nginx.org/nginx/rev/ea41bba49e8a
branches:
changeset: 5227:ea41bba49e8a
user: Valentin Bartenev <vbart@nginx.com>
date: Thu May 23 20:30:27 2013 +0400
description:
Core: strengthen configuration syntax checker.

It is now a syntax error if tokens passed to a custom configuration
handler are terminated by "{".

The following incorrect configuration is now properly rejected:

map $v $v2 {
a b {
c d {
e f {
}

diffstat:

src/core/ngx_conf_file.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r a30ea5c6451d -r ea41bba49e8a src/core/ngx_conf_file.c
--- a/src/core/ngx_conf_file.c Thu May 23 16:26:10 2013 +0400
+++ b/src/core/ngx_conf_file.c Thu May 23 20:30:27 2013 +0400
@@ -225,6 +225,11 @@ ngx_conf_parse(ngx_conf_t *cf, ngx_str_t
* "types { ... }" directive
*/

+ if (rc == NGX_CONF_BLOCK_START) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "unexpected \"{\"");
+ goto failed;
+ }
+
rv = (*cf->handler)(cf, NULL, cf->handler_conf);
if (rv == NGX_CONF_OK) {
continue;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Core: strengthen configuration syntax checker.

Valentin Bartenev 747 May 23, 2013 12:34PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 185
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready