fixed possible issue in sceNetResolverStartAton (found in bloodborne alpha)

This commit is contained in:
georgemoralis 2025-01-10 19:49:40 +02:00
parent 4c625c75cc
commit e4d999d147
2 changed files with 12 additions and 1 deletions

View File

@ -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;
} }

View File

@ -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;
} }