mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-17 19:49:12 +01:00
Replaced DEBUG_SSL with INI options
This commit is contained in:
parent
55ec1b69fc
commit
170d0588a7
@ -82,6 +82,7 @@ void SConfig::SaveSettings()
|
|||||||
SaveInputSettings(ini);
|
SaveInputSettings(ini);
|
||||||
SaveFifoPlayerSettings(ini);
|
SaveFifoPlayerSettings(ini);
|
||||||
SaveAnalyticsSettings(ini);
|
SaveAnalyticsSettings(ini);
|
||||||
|
SaveNetworkSettings(ini);
|
||||||
|
|
||||||
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||||
m_SYSCONF->Save();
|
m_SYSCONF->Save();
|
||||||
@ -312,6 +313,14 @@ void SConfig::SaveFifoPlayerSettings(IniFile& ini)
|
|||||||
fifoplayer->Set("LoopReplay", bLoopFifoReplay);
|
fifoplayer->Set("LoopReplay", bLoopFifoReplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SConfig::SaveNetworkSettings(IniFile& ini)
|
||||||
|
{
|
||||||
|
IniFile::Section* network = ini.GetOrCreateSection("Network");
|
||||||
|
|
||||||
|
network->Set("SSLDumpRead", m_SSLDumpRead);
|
||||||
|
network->Set("SSLDumpWrite", m_SSLDumpWrite);
|
||||||
|
}
|
||||||
|
|
||||||
void SConfig::SaveAnalyticsSettings(IniFile& ini)
|
void SConfig::SaveAnalyticsSettings(IniFile& ini)
|
||||||
{
|
{
|
||||||
IniFile::Section* analytics = ini.GetOrCreateSection("Analytics");
|
IniFile::Section* analytics = ini.GetOrCreateSection("Analytics");
|
||||||
@ -336,6 +345,7 @@ void SConfig::LoadSettings()
|
|||||||
LoadDSPSettings(ini);
|
LoadDSPSettings(ini);
|
||||||
LoadInputSettings(ini);
|
LoadInputSettings(ini);
|
||||||
LoadFifoPlayerSettings(ini);
|
LoadFifoPlayerSettings(ini);
|
||||||
|
LoadNetworkSettings(ini);
|
||||||
LoadAnalyticsSettings(ini);
|
LoadAnalyticsSettings(ini);
|
||||||
|
|
||||||
m_SYSCONF = new SysConf();
|
m_SYSCONF = new SysConf();
|
||||||
@ -602,6 +612,14 @@ void SConfig::LoadFifoPlayerSettings(IniFile& ini)
|
|||||||
fifoplayer->Get("LoopReplay", &bLoopFifoReplay, true);
|
fifoplayer->Get("LoopReplay", &bLoopFifoReplay, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SConfig::LoadNetworkSettings(IniFile& ini)
|
||||||
|
{
|
||||||
|
IniFile::Section* network = ini.GetOrCreateSection("Network");
|
||||||
|
|
||||||
|
network->Get("SSLDumpRead", &m_SSLDumpRead, false);
|
||||||
|
network->Get("SSLDumpWrite", &m_SSLDumpWrite, false);
|
||||||
|
}
|
||||||
|
|
||||||
void SConfig::LoadAnalyticsSettings(IniFile& ini)
|
void SConfig::LoadAnalyticsSettings(IniFile& ini)
|
||||||
{
|
{
|
||||||
IniFile::Section* analytics = ini.GetOrCreateSection("Analytics");
|
IniFile::Section* analytics = ini.GetOrCreateSection("Analytics");
|
||||||
|
@ -273,6 +273,10 @@ struct SConfig : NonCopyable
|
|||||||
bool m_AdapterRumble[4];
|
bool m_AdapterRumble[4];
|
||||||
bool m_AdapterKonga[4];
|
bool m_AdapterKonga[4];
|
||||||
|
|
||||||
|
// Network settings
|
||||||
|
bool m_SSLDumpRead;
|
||||||
|
bool m_SSLDumpWrite;
|
||||||
|
|
||||||
SysConf* m_SYSCONF;
|
SysConf* m_SYSCONF;
|
||||||
|
|
||||||
// Save settings
|
// Save settings
|
||||||
@ -299,6 +303,7 @@ private:
|
|||||||
void SaveInputSettings(IniFile& ini);
|
void SaveInputSettings(IniFile& ini);
|
||||||
void SaveMovieSettings(IniFile& ini);
|
void SaveMovieSettings(IniFile& ini);
|
||||||
void SaveFifoPlayerSettings(IniFile& ini);
|
void SaveFifoPlayerSettings(IniFile& ini);
|
||||||
|
void SaveNetworkSettings(IniFile& ini);
|
||||||
void SaveAnalyticsSettings(IniFile& ini);
|
void SaveAnalyticsSettings(IniFile& ini);
|
||||||
|
|
||||||
void LoadGeneralSettings(IniFile& ini);
|
void LoadGeneralSettings(IniFile& ini);
|
||||||
@ -310,6 +315,7 @@ private:
|
|||||||
void LoadInputSettings(IniFile& ini);
|
void LoadInputSettings(IniFile& ini);
|
||||||
void LoadMovieSettings(IniFile& ini);
|
void LoadMovieSettings(IniFile& ini);
|
||||||
void LoadFifoPlayerSettings(IniFile& ini);
|
void LoadFifoPlayerSettings(IniFile& ini);
|
||||||
|
void LoadNetworkSettings(IniFile& ini);
|
||||||
void LoadAnalyticsSettings(IniFile& ini);
|
void LoadAnalyticsSettings(IniFile& ini);
|
||||||
|
|
||||||
static SConfig* m_Instance;
|
static SConfig* m_Instance;
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
|
#include "Core/ConfigManager.h"
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
||||||
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
|
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
|
||||||
@ -344,10 +345,10 @@ void WiiSocket::Update(bool read, bool write, bool except)
|
|||||||
int ret = mbedtls_ssl_write(&CWII_IPC_HLE_Device_net_ssl::_SSL[sslID].ctx,
|
int ret = mbedtls_ssl_write(&CWII_IPC_HLE_Device_net_ssl::_SSL[sslID].ctx,
|
||||||
Memory::GetPointer(BufferOut2), BufferOutSize2);
|
Memory::GetPointer(BufferOut2), BufferOutSize2);
|
||||||
|
|
||||||
#ifdef DEBUG_SSL
|
if (SConfig::GetInstance().m_SSLDumpWrite && ret > 0)
|
||||||
File::IOFile("ssl_write.bin", "ab")
|
File::IOFile("ssl_write.bin", "ab")
|
||||||
.WriteBytes(Memory::GetPointer(BufferOut2), BufferOutSize2);
|
.WriteBytes(Memory::GetPointer(BufferOut2), ret);
|
||||||
#endif
|
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
// Return bytes written or SSL_ERR_ZERO if none
|
// Return bytes written or SSL_ERR_ZERO if none
|
||||||
@ -378,12 +379,11 @@ void WiiSocket::Update(bool read, bool write, bool except)
|
|||||||
{
|
{
|
||||||
int ret = mbedtls_ssl_read(&CWII_IPC_HLE_Device_net_ssl::_SSL[sslID].ctx,
|
int ret = mbedtls_ssl_read(&CWII_IPC_HLE_Device_net_ssl::_SSL[sslID].ctx,
|
||||||
Memory::GetPointer(BufferIn2), BufferInSize2);
|
Memory::GetPointer(BufferIn2), BufferInSize2);
|
||||||
#ifdef DEBUG_SSL
|
|
||||||
if (ret > 0)
|
if (SConfig::GetInstance().m_SSLDumpRead && ret > 0)
|
||||||
{
|
File::IOFile("ssl_read.bin", "ab")
|
||||||
File::IOFile("ssl_read.bin", "ab").WriteBytes(Memory::GetPointer(BufferIn2), ret);
|
.WriteBytes(Memory::GetPointer(BufferIn2), ret);
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
// Return bytes read or SSL_ERR_ZERO if none
|
// Return bytes read or SSL_ERR_ZERO if none
|
||||||
|
Loading…
x
Reference in New Issue
Block a user