Browse Source

Merged in cwalther/cwe/launcherstatusmessagecrash (pull request #38)

Don't crash the launcher when the HTTP request for getting the server status message fails

This should fix the crash in UruLauncher.exe after starting UruExplorer.exe, reported by Treehugger at http://forums.openuru.org/viewtopic.php?p=8976#p8976 . It is the same issue as addressed in pull request #31 for the login dialog.

Untested because testing it is hard when the launcher patches itself out.
mdeforest/changed-password-hashing-to-try-sha1-fir-1492090943988
Christian Walther 7 years ago
parent
commit
791886bdab
  1. 10
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Main.cpp

10
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Main.cpp

@ -668,7 +668,7 @@ static void HttpRequestGet(HINTERNET hConnect)
const wchar *path = BuildTypeServerStatusPath();
HINTERNET hRequest = 0;
char data[256] = {0};
DWORD bytesRead;
DWORD bytesRead = 0;
hRequest = WinHttpOpenRequest(
hConnect,
@ -693,9 +693,11 @@ static void HttpRequestGet(HINTERNET hConnect)
if(b)
{
DWORD err = GetLastError();
WinHttpReceiveResponse(hRequest, 0);
WinHttpReadData(hRequest, data, arrsize(data)-1, &bytesRead);
data[bytesRead] = 0;
if (WinHttpReceiveResponse(hRequest, 0)
&& WinHttpReadData(hRequest, data, arrsize(data) - 1, &bytesRead))
{
data[bytesRead] = 0;
}
}
}
if(bytesRead)

Loading…
Cancel
Save