Merge pull request #8389 from sepalani/fix-so

Socket: Abort pending ops on close
This commit is contained in:
Léo Lam 2020-04-22 07:19:25 +02:00 committed by GitHub
commit 2673280614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -170,6 +170,12 @@ s32 WiiSocket::CloseFd()
ReturnValue = WiiSockMan::GetNetErrorCode(EITHER(WSAENOTSOCK, EBADF), "CloseFd", false);
}
fd = -1;
for (auto it = pending_sockops.begin(); it != pending_sockops.end();)
{
GetIOS()->EnqueueIPCReply(it->request, -SO_ENOTCONN);
it = pending_sockops.erase(it);
}
return ReturnValue;
}