We just had a long discussion with Jan and Michal, and the result is that: - if (@rr.param.lr) will return false if the parameter exists, but has empty body. So there will be no change, perl and pyton work the same way.
- a new function will be introduced that can be used to explicitly check the existence of a header or parameter, something like if (exists((@rr.param.lr)) than... - errors during evaluation will be treated as if the condition did not match unless the operator is DIFF_OP (!=). So the evaluator will not stop, it will continue examining the remaining part if necessary. - ser configurations have to be reviewed, and may be modified - the code has to be backported to 2.0, because it is a major issue. If you do not agree, please speak up now. Thanks, Miklos On 04/14/2008 01:31 PM, Jan Janak wrote: > Miklos Tirpak wrote: >> Hi all, >> >> there is an issue with error handling as well, the result of an >> expression evaluation that causes error can be hardly determined, for >> example: >> >> @rr.uri tries to parse the RR HF, and get the URI part of it, but it >> returns an error if the RR HF is missing from the request, because the >> parsing fails: >> >> if (@rr.uri) is false, which is correct. >> >> if ([EMAIL PROTECTED]) is also false, which is strange. The error is >> captured, >> and eval_expr() exists before negating the result. >> >> if (@rr.uri || 1) is also false, because nothing after @rr.uri is checked. >> >> The problem exists with AVPs as well: >> >> $second = 2; >> if ($second != "foo") is false, which means 2=="foo". The reason is the >> same as above, the string cannot be converted to integer, thus, the >> evaluator returns error. >> >> None of the above expressions should result error in my opinion, they >> could simply return true or false instead. What do you think? > > Yes, I agree, I was my impression that is already worked that way, but > probably not. > > Jan. _______________________________________________ Serdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/serdev
