Browse code

core: skip dns srv for websocket after check if domain is ip

- reported by Peter Dunkley

Daniel-Constantin Mierla authored on 02/10/2013 12:15:18
Showing 1 changed files
... ...
@@ -2670,10 +2670,6 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
2670 2670
 	}else{
2671 2671
 		srv_proto=PROTO_UDP;
2672 2672
 	}
2673
-	if(srv_proto==PROTO_WS || srv_proto==PROTO_WS) {
2674
-		/* no srv records for web sockets */
2675
-		return 0;
2676
-	}
2677 2673
 	/* try SRV if no port specified (draft-ietf-sip-srv-06) */
2678 2674
 	if ((port)&&(*port==0)){
2679 2675
 		*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,
2690 2686
 				return ip_addr2he(name,ip);
2691 2687
 			}
2692 2688
 
2689
+			if(srv_proto==PROTO_WS || srv_proto==PROTO_WS) {
2690
+				/* no srv records for web sockets */
2691
+				return 0;
2692
+			}
2693
+
2693 2694
 			switch(srv_proto){
2694 2695
 				case PROTO_NONE: /* no proto specified, use udp */
2695 2696
 					if (proto)