Browse Source

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

Same thing as 82d9c3a57879, more or less.
launcherstatusmessagecrash
Christian Walther 8 years ago
parent
commit
b74e9f47bb
  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