From 5f179cf19ff3f4edad3e062b55724bd41cf7ba47 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 21 Jan 2019 22:24:19 -0800 Subject: [PATCH] set.mitm: increase memory, fix race condition that could cause hang during boot --- stratosphere/set_mitm/source/setmitm_main.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/stratosphere/set_mitm/source/setmitm_main.cpp b/stratosphere/set_mitm/source/setmitm_main.cpp index 9df353cbe..44a5b3172 100644 --- a/stratosphere/set_mitm/source/setmitm_main.cpp +++ b/stratosphere/set_mitm/source/setmitm_main.cpp @@ -31,7 +31,7 @@ extern "C" { u32 __nx_applet_type = AppletType_None; - #define INNER_HEAP_SIZE 0x28000 + #define INNER_HEAP_SIZE 0x50000 size_t nx_inner_heap_size = INNER_HEAP_SIZE; char nx_inner_heap[INNER_HEAP_SIZE]; @@ -61,6 +61,11 @@ void __appInit(void) { fatalSimple(MAKERESULT(Module_Libnx, LibnxError_InitFail_SM)); } + rc = setsysInitialize(); + if (R_FAILED(rc)) { + fatalSimple(rc); + } + CheckAtmosphereVersion(CURRENT_ATMOSPHERE_VERSION); } @@ -86,19 +91,11 @@ int main(int argc, char **argv) SettingsItemManager::RefreshConfiguration(); /* TODO: What's a good timeout value to use here? */ - auto server_manager = new SetMitmManager(1); + auto server_manager = new SetMitmManager(3); /* Create set:sys mitm. */ AddMitmServerToManager(server_manager, "set:sys", 60); - /* Connect to set:sys. */ - { - Result rc = setsysInitialize(); - if (R_FAILED(rc)) { - fatalSimple(rc); - } - } - /* Loop forever, servicing our services. */ server_manager->Process();