فهرست منبع

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

- reported by Peter Dunkley
Daniel-Constantin Mierla 12 سال پیش
والد
کامیت
5db86a941a
1فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 5 4
      dns_cache.c

+ 5 - 4
dns_cache.c

@@ -2670,10 +2670,6 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
 	}else{
 	}else{
 		srv_proto=PROTO_UDP;
 		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) */
 	/* try SRV if no port specified (draft-ietf-sip-srv-06) */
 	if ((port)&&(*port==0)){
 	if ((port)&&(*port==0)){
 		*port=(srv_proto==PROTO_TLS)?SIPS_PORT:SIP_PORT; /* just in case we
 		*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);
 				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){
 			switch(srv_proto){
 				case PROTO_NONE: /* no proto specified, use udp */
 				case PROTO_NONE: /* no proto specified, use udp */
 					if (proto)
 					if (proto)