Stability fixes for network recv and ssl_read functions. Sometimes dolphin is just too fast!

This commit is contained in:
Matthew Parlane 2012-01-27 00:35:43 +13:00
parent bd27982901
commit 43ba6ce6e5
2 changed files with 18 additions and 5 deletions

View File

@ -471,18 +471,20 @@ static int getNetErrorCode(int ret, std::string caller, bool isRW)
if (ret>= 0)
return ret;
INFO_LOG(WII_IPC_NET, "%s failed with error %d: %s, ret= %d\n",
WARN_LOG(WII_IPC_NET, "%s failed with error %d: %s, ret= %d\n",
caller.c_str(), errorCode, DecodeError(errorCode), ret);
switch (errorCode)
{
case 10040:
INFO_LOG(WII_IPC_NET, "Find out why this happened, looks like PEEK failure?\n");
WARN_LOG(WII_IPC_NET, "Find out why this happened, looks like PEEK failure?\n");
return -1;
case 10054:
return -15;
case 10056:
return -30;
case 10057:
return -6;
case 10035:
if(isRW){
return -6;

View File

@ -468,7 +468,7 @@ u32 CWII_IPC_HLE_Device_net_ssl::ExecuteCommandV(u32 _Parameter, SIOCtlVBuffer C
if (returnValue == -1)
returnValue = -SSL_get_error(ssl, returnValue);
Memory::Write_U32(returnValue, _BufferIn);
returnValue = 0;
//returnValue = 0;
}
INFO_LOG(WII_IPC_NET, "/dev/net/ssl::IOCtlV request IOCTLV_NET_SSL_WRITE "
"BufferIn: (%08x, %i), BufferIn2: (%08x, %i), "
@ -504,9 +504,20 @@ u32 CWII_IPC_HLE_Device_net_ssl::ExecuteCommandV(u32 _Parameter, SIOCtlVBuffer C
{
SSL* ssl = sslfds[sslID];
returnValue = SSL_read(ssl, Memory::GetPointer(_BufferIn2), BufferInSize2);
if (returnValue == -1)
if (returnValue == -1){
returnValue = -SSL_get_error(ssl, returnValue);
WARN_LOG(WII_IPC_NET, "/dev/net/ssl::IOCtlV request IOCTLV_NET_SSL_READ errorVal= %d", returnValue);
}
if (returnValue == -1)
returnValue = -SSL_ERROR_WANT_READ;
if (returnValue == -5){
int errorCode = WSAGetLastError();
if (errorCode == 10057){
returnValue = -SSL_ERROR_WANT_READ;
}else{
WARN_LOG(WII_IPC_NET, "/dev/net/ssl::IOCtlV request IOCTLV_NET_SSL_READ ERRORCODE= %d", WSAGetLastError());
}
}
SSL_load_error_strings();
FILE *quickDump = fopen("quickdump.txt", "ab");
ERR_print_errors_fp(quickDump);