2007/2/16, Colin Whittaker <[EMAIL PROTECTED]>: > Well, that didn't really work... The for loop doesn't traverse when there > is one server.
Thanks for the patches. I tried to figure out what the surrounding code does, and I think the logic calling sres_next_server() and reacting to permanent/transient errors was pretty demented. So, in addition to your fixes I tried to clarify the logic there, too. I have not given the patch a real try yet, however. --Pekka > Here is another attempt: > sres.c > 2688a2689,2690 > > #define DNS_ICMP_TIMEOUT 60 // Retry after 1 min and > ICMP error > > #define DNS_ERROR_TIMEOUT 3600 // Retry after 1 hour and "perm" > error > 2697a2700 > > time_t now = time(NULL); > 2705a2709,2720 > > > > for ( j=0; j<N; j++ ) { > > if ( servers[j] ) > > { > > if (servers[j]->dns_icmp + DNS_ICMP_TIMEOUT < now ) { > > servers[j]->dns_icmp = 0; > > } > > if (servers[j]->dns_error + DNS_ERROR_TIMEOUT < now ) { > > servers[j]->dns_error = 0; > > } > > } > > } > > Colin Whittaker wrote: > Ok, I took a stab a this, but I think you may have a better or more > complete solution. > I basically just timed out the dns_icmp and dns_error on the servers. > Here is the diff: > sres.c > 2688a2689,2690 > > #define DNS_ICMP_TIMEOUT 60 // Retry after 1 min and > ICMP error > > #define DNS_ERROR_TIMEOUT 3600 // Retry after 1 hour and "perm" > error > 2697a2700 > > time_t now = time(NULL); > 2708a2712,2714 > > if (servers[j]->dns_icmp + DNS_ICMP_TIMEOUT > now ) { > > servers[j]->dns_icmp = 0; > > } > 2714a2721,2723 > > if (servers[j]->dns_error + DNS_ERROR_TIMEOUT > now ) { > > servers[j]->dns_error = 0; > > } > > > > Pekka Pessi wrote: > Sorry for the way too long delay, IƤve been away for the holidays. > > On 12/12/06, Colin Whittaker <[EMAIL PROTECTED]> wrote: > > > > You are right, it does not use /etc/hosts or nsswitch.conf (or > /etc/host.conf) > > > > Hmm, seems like folks setting these things up would expect an application > that uses DNS to use them. At least a lookup in /etc/hosts if DNS fails. > > You are absolutely correct, the folks expect them to be used, but it > is a bit too hairy for my taste. If you like to add host name > resolving to the nta or sresolv, please go ahead. > > > > > That is correct. The default domain or search domains are only used > with sres_search(). The SIP/SIPS URI are resolved using three-phase > algorithm explained in RFC 3263 and with sres_query() which never uses > search domains. > > > > It doesn't appear sres_search() is used by the NUA stack. > > Nope, only sres_query(). sres_search() (for initial A/AAAA-record > query?) should be a drop-in replacement. > > > > There are some problems with sres_query(), too (it abandons the search > after the initial absolute query fails). > > This seems like a bad bug. If the DNS server ever looses contact, you > basically loose all functionality until you bounce the stack. > > > > I think I have seen this. If the DNS is not up when I start a REGISTER, I > get a 503 error. Then when DNS is up, I try to REGISTER again, the stack > never sends another DNS query and I get a 503 error. Forever. seem like a > blocker to me. :-) > > Hm. It looks like once a permanent error occurs, the server is not > tried again. I think this is not the intention. > > > > Do you think this something easy to fix ? Should I start digging into it ? > > Please go ahead. > > I think the algorithm selecting the server in sres_send_dns_query() > and sres_next_server() should work so that > 1) a query is always sent once unless if all servers have a permanent > error (send > returns immediately -1 for every server) > 2) a query is retried only when there has been "enough time" from last > dns_icmp > > > > > There are a few open issues with using /etc/hosts or search domains. > At which point we should use /etc/hosts (or gethostbyname())? Should > nua or nta expand a host name in URI to a FQDN before sending it to a > network? > > > > I don't think the URI should be modified. If the URI is entered as just a > host, I think it is reasonable to expect that all servers will be able to > resolve that host as entered in the URI. > > OK. > > > > I am using NUTAG_PROXY() and NUTAG_REGISTRAR(), which take URIs, but just > specify hosts right ? > Here is where I really expected search domains to be used. > > I guess NUTAG_PROXY() is a special case, and there we should try to > resolve host names, too. > > > ________________________________ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ________________________________ > > _______________________________________________ > Sofia-sip-devel mailing list > Sofia-sip-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel > > -- Pekka.Pessi mail at nokia.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel