Hi, I set "from_uri = out" in "lcr" table. Then I call:
$var(destination) = "out"; load_gws("$var(destination)")
or:
$var(destination) = "no-out"; load_gws("$var(destination)")
or:
$var(destination) = "no-out-lalala"; load_gws("$var(destination)")
In any case LCR matches the rules of "lcr" table with "from_uri = out" !!!
If I set:
$var(destination) = "nooooo"; load_gws("$var(destination)")
then rules are not loaded (as expected).
So it seems that load_gws(pvar) does an internal match like: if table_from_uri =~ /PVAR_VALUE/
IMHO it should do: if table_from_uri =~ /^PVAR_VALUE$/
Iñaki Baz Castillo writes:
So it seems that load_gws(pvar) does an internal match like: if table_from_uri =~ /PVAR_VALUE/
IMHO it should do: if table_from_uri =~ /^PVAR_VALUE$/
inaki,
i don't know if this answers your question, but from_uri is 'man pcresyntax' regular expression, not a simple string.
-- juha
2010/4/20 Juha Heinanen jh@tutpro.com:
i don't know if this answers your question, but from_uri is 'man pcresyntax' regular expression, not a simple string.
Yes, I expected it, but then the regular expression should start by "^" and end by "$" so the bug I've reported wouldn't occur. Do you agree?
Thanks.
PS: Take your dinner ;)
Iñaki Baz Castillo writes:
Yes, I expected it, but then the regular expression should start by "^" and end by "$" so the bug I've reported wouldn't occur. Do you agree?
i don't quite understand, but if you want from uri to match to string "out" and nothing else, you should have ^out$ in from_uri column.
-- juha
2010/4/20 Juha Heinanen jh@tutpro.com:
Iñaki Baz Castillo writes:
> Yes, I expected it, but then the regular expression should start by > "^" and end by "$" so the bug I've reported wouldn't occur. Do you > agree?
i don't quite understand, but if you want from uri to match to string "out" and nothing else, you should have ^out$ in from_uri column.
ah ok, so the regular expression is made from the "from_uri" value in the 'lcr' table, I understand now.
Iñaki Baz Castillo writes:
ah ok, so the regular expression is made from the "from_uri" value in the 'lcr' table, I understand now.
yes, and in 3.0 there can be any number of lcr instances, which may make it unnecessary to use non-empty from column. for example, if you want all users belonging to a particular domain to use a specific gateway, you can define an lcr instance for that domain.
-- juha
2010/4/20 Juha Heinanen jh@tutpro.com:
Iñaki Baz Castillo writes:
> ah ok, so the regular expression is made from the "from_uri" value in > the 'lcr' table, I understand now.
yes, and in 3.0 there can be any number of lcr instances, which may make it unnecessary to use non-empty from column. for example, if you want all users belonging to a particular domain to use a specific gateway, you can define an lcr instance for that domain.
This is great. Thanks.