1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Fix get candidate IP bug.

This commit is contained in:
winlin 2020-05-26 13:08:56 +08:00
parent 2b50326e97
commit f3e1d28b6b

View file

@ -82,7 +82,7 @@ static std::vector<std::string> get_candidate_ips()
string family = _srs_config->get_rtc_server_ip_family(); string family = _srs_config->get_rtc_server_ip_family();
for (int i = 0; i < (int)ips.size(); ++i) { for (int i = 0; i < (int)ips.size(); ++i) {
SrsIPAddress* ip = ips[i]; SrsIPAddress* ip = ips[i];
if (!ip->is_loopback) { if (ip->is_loopback) {
continue; continue;
} }
@ -94,7 +94,7 @@ static std::vector<std::string> get_candidate_ips()
} }
candidate_ips.push_back(ip->ip); candidate_ips.push_back(ip->ip);
srs_warn("Best matched ip=%s, ifname=%s", ip->ip.c_str(), ip->ifname.c_str()); srs_trace("Best matched ip=%s, ifname=%s", ip->ip.c_str(), ip->ifname.c_str());
} }
if (!candidate_ips.empty()) { if (!candidate_ips.empty()) {
@ -109,7 +109,7 @@ static std::vector<std::string> get_candidate_ips()
} }
candidate_ips.push_back(ip->ip); candidate_ips.push_back(ip->ip);
srs_warn("No best matched, use first ip=%s, ifname=%s", ip->ip.c_str(), ip->ifname.c_str()); srs_trace("No best matched, use first ip=%s, ifname=%s", ip->ip.c_str(), ip->ifname.c_str());
return candidate_ips; return candidate_ips;
} }