mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix client tools resolve dns failed bug
This commit is contained in:
parent
c20b819a29
commit
0d78b908a7
7 changed files with 21 additions and 14 deletions
|
@ -1117,7 +1117,7 @@ string srs_get_local_ip(int fd)
|
|||
char* h = (char*)saddr;
|
||||
socklen_t nbh = (socklen_t)sizeof(saddr);
|
||||
const int r0 = getnameinfo((const sockaddr*)&addr, addrlen, h, nbh,NULL, 0, NI_NUMERICHOST);
|
||||
if(r0 != 0) {
|
||||
if(r0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -1159,7 +1159,7 @@ string srs_get_peer_ip(int fd)
|
|||
char* h = (char*)saddr;
|
||||
socklen_t nbh = (socklen_t)sizeof(saddr);
|
||||
const int r0 = getnameinfo((const sockaddr*)&addr, addrlen, h, nbh, NULL, 0, NI_NUMERICHOST);
|
||||
if(r0 != 0) {
|
||||
if(r0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue