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. 8
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Main.cpp

8
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,11 +693,13 @@ static void HttpRequestGet(HINTERNET hConnect)
if(b)
{
DWORD err = GetLastError();
WinHttpReceiveResponse(hRequest, 0);
WinHttpReadData(hRequest, data, arrsize(data)-1, &bytesRead);
if (WinHttpReceiveResponse(hRequest, 0)
&& WinHttpReadData(hRequest, data, arrsize(data) - 1, &bytesRead))
{
data[bytesRead] = 0;
}
}
}
if(bytesRead)
SetStatusText(data);
WinHttpCloseHandle(hRequest);

Loading…
Cancel
Save