summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2012-01-27 00:35:43 +1300
committerMatthew Parlane <parlane@gmail.com>2012-01-27 00:35:43 +1300
commit43ba6ce6e558fa5cbd7d50a12ba5998c82f07e87 (patch)
tree4ee165a5084fd8c12dd72ede3ac76393d0993ad3 /Source/Core
parentbd279829011d5eb25d3d4459b398eb2811cc76d5 (diff)
Stability fixes for network recv and ssl_read functions. Sometimes dolphin is just too fast!
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp6
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp17
2 files changed, 18 insertions, 5 deletions
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
index aad1b4489b..8aeefb0c3e 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
@@ -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;
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp
index f07f372dc1..4b82ef9142 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp
@@ -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);