mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix some closesocket bugs
This commit is contained in:
parent
8505e24812
commit
fcb3d636b4
1 changed files with 14 additions and 1 deletions
|
@ -798,10 +798,17 @@ static int sceNetInetClose(int socket) {
|
|||
return hleLogError(Log::sceNet, ERROR_INET_EBADF, "Bad socket #%d", socket);
|
||||
}
|
||||
|
||||
int retVal = closesocket(socket);
|
||||
int retVal = closesocket(inetSock->sock);
|
||||
if (retVal == 0) {
|
||||
inetSock->sock = 0;
|
||||
inetSock->state = SocketState::Unused;
|
||||
} else {
|
||||
ERROR_LOG(Log::sceNet, "closesocket(%d) failed (socket=%d)", inetSock->sock, socket);
|
||||
}
|
||||
return hleLogSuccessI(Log::sceNet, retVal);
|
||||
}
|
||||
|
||||
// TODO: How is this different than just sceNetInetClose?
|
||||
static int sceNetInetCloseWithRST(int socket) {
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s(%i) at %08x", __FUNCTION__, socket, currentMIPS->pc);
|
||||
|
||||
|
@ -816,6 +823,12 @@ static int sceNetInetCloseWithRST(int socket) {
|
|||
sl.l_linger = 0; // timeout interval in seconds
|
||||
setsockopt(inetSock->sock, SOL_SOCKET, SO_LINGER, (const char*)&sl, sizeof(sl));
|
||||
int retVal = closesocket(inetSock->sock);
|
||||
if (retVal == 0) {
|
||||
inetSock->sock = 0;
|
||||
inetSock->state = SocketState::Unused;
|
||||
} else {
|
||||
ERROR_LOG(Log::sceNet, "closesocket(%d) failed (socket=%d)", inetSock->sock, socket);
|
||||
}
|
||||
return hleLogSuccessI(Log::sceNet, retVal);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue