Module: sip-router Branch: master Commit: 5db86a941a909c17a0f9ee1b04febbe4c60033bd URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5db86a94...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Oct 2 14:15:18 2013 +0200
core: skip dns srv for websocket after check if domain is ip
- reported by Peter Dunkley
---
dns_cache.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dns_cache.c b/dns_cache.c index 2d7278c..949aab6 100644 --- a/dns_cache.c +++ b/dns_cache.c @@ -2670,10 +2670,6 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port, }else{ srv_proto=PROTO_UDP; } - if(srv_proto==PROTO_WS || srv_proto==PROTO_WS) { - /* no srv records for web sockets */ - return 0; - } /* try SRV if no port specified (draft-ietf-sip-srv-06) */ if ((port)&&(*port==0)){ *port=(srv_proto==PROTO_TLS)?SIPS_PORT:SIP_PORT; /* just in case we @@ -2690,6 +2686,11 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port, return ip_addr2he(name,ip); }
+ if(srv_proto==PROTO_WS || srv_proto==PROTO_WS) { + /* no srv records for web sockets */ + return 0; + } + switch(srv_proto){ case PROTO_NONE: /* no proto specified, use udp */ if (proto)