mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
fixed possible issue in sceNetResolverStartAton (found in bloodborne alpha)
This commit is contained in:
parent
4c625c75cc
commit
e4d999d147
@ -971,7 +971,11 @@ int PS4_SYSV_ABI sceNetResolverStartAton(int rid, const u32* addr, char* hostnam
|
|||||||
LOG_ERROR(Lib_Net, "rid = {} , hostname_len ={} timeout={} retry={} flags={}", rid,
|
LOG_ERROR(Lib_Net, "rid = {} , hostname_len ={} timeout={} retry={} flags={}", rid,
|
||||||
hostname_len, timeout, retry, flags);
|
hostname_len, timeout, retry, flags);
|
||||||
struct hostent* resolved = gethostbyaddr((const char*)addr, hostname_len, AF_INET);
|
struct hostent* resolved = gethostbyaddr((const char*)addr, hostname_len, AF_INET);
|
||||||
strcpy(hostname, resolved->h_name);
|
if (resolved != nullptr) {
|
||||||
|
strcpy(hostname, resolved->h_name);
|
||||||
|
} else {
|
||||||
|
strcpy(hostname, "localhost"); // dummy
|
||||||
|
}
|
||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,13 @@ int PosixSocket::SetSocketOptions(int level, int optname, const void* optval, un
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (level == IPPROTO_TCP) {
|
||||||
|
switch (optname) {
|
||||||
|
case ORBIS_NET_TCP_NODELAY:
|
||||||
|
return ConvertReturnErrorCode(
|
||||||
|
setsockopt(sock, level, TCP_NODELAY, (const char*)optval, optlen));
|
||||||
|
}
|
||||||
|
}
|
||||||
UNREACHABLE_MSG("Unknown level ={} optname ={}", level, optname);
|
UNREACHABLE_MSG("Unknown level ={} optname ={}", level, optname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user