[sr-dev] doubt about from_gw() with proto=ANY

Andrew Pogrebennyk apogrebennyk at sipwise.com
Wed Jul 4 13:13:01 CEST 2012


Juha, thanks for getting back to me.
The code as shown works for me, however another check may be required
if transport != PROTO_NONE but value stored in the database is NULL
(PROTO_ANY). And at a glance do_to_gw function also has this problem.

On 07/03/2012 02:34 PM, Juha Heinanen wrote:
> you could try to change the above to this:
> 
>       if ((res != NULL) &&
>   	((transport == PROTO_NONE) || (res->transport == transport))) {
> 
>> > And what is the last check for: (res->transport == PROTO_NONE) &&
>> > (transport == PROTO_UDP) ?
> looks like it is old code from the time when PROTO_NONE didn't mean ANY,
> but that transport protocol was not defined, in which case it defaulted
> to UDP.
> 
> i'm not personally using these test functions anymore, since i consider htable
> based solution a better alternative.





More information about the sr-dev mailing list