Re: regtest failure for /cache/h00000.vtc, config parsing fails? after commit 7805e2b

2018-12-02 Thread Willy Tarreau
On Sun, Dec 02, 2018 at 09:58:40AM +0100, Christopher Faulet wrote:
> Argh! You're right. I was in hurry to finish all my work on the HTX. Here is
> a fix.

Applied, thanks Christopher. I initially thought the problem was on
my side but I was too busy integrating the rest of the stuff we have
to take a look at it.

Willy



Re: regtest failure for /cache/h00000.vtc, config parsing fails? after commit 7805e2b

2018-12-02 Thread Christopher Faulet

Le 01/12/2018 à 22:48, PiBa-NL a écrit :

Hi Christopher, List

A recent commit
http://git.haproxy.org/?p=haproxy.git;a=commit;h=7805e2bc1faf04169866c801087fd794535ecbb2
seems to have broken config parsing for some configurations as seen with
reg-test: /cache/h0.vtc

Using: haproxy version: 1.9-dev8-7805e2b

***  h1    0.0 debug|[ALERT] 334/200950 (30141) : Proxy 'test': unable
to find the cache 'my_cache' referenced by http-response cache-store rule.
***  h1    0.0 debug|[ALERT] 334/200950 (30141) : Proxy 'test': unable
to find the cache 'my_cache' referenced by http-request cache-use rule.
***  h1    0.0 debug|[ALERT] 334/200950 (30141) : Proxy 'test': unable
to find the cache 'my_cache' referenced by the filter 'cache'.
***  h1    0.0 debug|[ALERT] 334/200950 (30141) : Fatal errors found in
configuration.

Can you take a look? Thanks in advance :).

Regards,

PiBa-NL (Pieter)




Argh! You're right. I was in hurry to finish all my work on the HTX. 
Here is a fix.


Thanks,

--
Christopher Faulet
>From 641ebec149de991052a707aa00d31d97ddb367ff Mon Sep 17 00:00:00 2001
From: Christopher Faulet 
Date: Sun, 2 Dec 2018 09:37:38 +0100
Subject: [PATCH] BUG/MINOR: cfgparse: Fix the call to post parser of the last
 sections parsed

Wrong variable was used to know if we need to call the callback
post_section_parser() or not. We must use 'cs' and not 'pcs'.

This patch must be backported in 1.8 with the commit 7805e2b ("BUG/MINOR:
cfgparse: Fix transition between 2 sections with the same name").
---
 src/cfgparse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cfgparse.c b/src/cfgparse.c
index a28d24cce..d754dd55e 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1890,8 +1890,8 @@ next_line:
 			err_code |= pcs->post_section_parser();
 			if (err_code & ERR_ABORT)
 goto err;
-			pcs = NULL;
 		}
+		pcs = NULL;
 
 		if (!cs) {
 			ha_alert("parsing [%s:%d]: unknown keyword '%s' out of section.\n", file, linenum, args[0]);
@@ -1903,7 +1903,7 @@ next_line:
 		}
 	}
 
-	if (cs && pcs->post_section_parser)
+	if (cs && cs->post_section_parser)
 		err_code |= cs->post_section_parser();
 
 err:
-- 
2.19.1



regtest failure for /cache/h00000.vtc, config parsing fails? after commit 7805e2b

2018-12-01 Thread PiBa-NL

Hi Christopher, List

A recent commit 
http://git.haproxy.org/?p=haproxy.git;a=commit;h=7805e2bc1faf04169866c801087fd794535ecbb2 
seems to have broken config parsing for some configurations as seen with 
reg-test: /cache/h0.vtc


Using: haproxy version: 1.9-dev8-7805e2b

***  h1    0.0 debug|[ALERT] 334/200950 (30141) : Proxy 'test': unable 
to find the cache 'my_cache' referenced by http-response cache-store rule.
***  h1    0.0 debug|[ALERT] 334/200950 (30141) : Proxy 'test': unable 
to find the cache 'my_cache' referenced by http-request cache-use rule.
***  h1    0.0 debug|[ALERT] 334/200950 (30141) : Proxy 'test': unable 
to find the cache 'my_cache' referenced by the filter 'cache'.
***  h1    0.0 debug|[ALERT] 334/200950 (30141) : Fatal errors found in 
configuration.


Can you take a look? Thanks in advance :).

Regards,

PiBa-NL (Pieter)




Config parsing

2013-02-11 Thread Aleksandr Vinokurov
Hello, Willy

I'm studing your code of haproxy and have a question: why you parse config
by hand and not use YACC/BISON or smth. like them?

-- 
Aleksandr Vinokurov
@aleksandrvin