Bug 1138794: Use an alternate crash report server on Windows XP SP2. r=ted a=lmandel

This commit is contained in:
David Major 2015-03-19 10:29:15 +13:00
parent 68a576a038
commit 9f98a06eed

View File

@ -12,6 +12,7 @@
#include "crashreporter.h"
#include <windows.h>
#include <versionhelpers.h>
#include <commctrl.h>
#include <richedit.h>
#include <shellapi.h>
@ -32,6 +33,9 @@
#define EMAIL_VALUE L"Email"
#define MAX_EMAIL_LENGTH 1024
#define SENDURL_ORIGINAL L"https://crash-reports.mozilla.com/submit"
#define SENDURL_XPSP2 L"https://crash-reports-xpsp2.mozilla.com/submit"
#define WM_UPLOADCOMPLETE WM_APP
// Thanks, Windows.h :(
@ -1300,6 +1304,14 @@ bool UIShowCrashUI(const StringTable& files,
gSendData.hDlg = nullptr;
gSendData.sendURL = UTF8ToWide(sendURL);
// Windows XP SP2 doesn't support the crash report server's crypto.
// This is a hack to use an alternate server.
if (!IsWindowsXPSP3OrGreater() &&
gSendData.sendURL.find(SENDURL_ORIGINAL) == 0) {
gSendData.sendURL.replace(0, ARRAYSIZE(SENDURL_ORIGINAL) - 1,
SENDURL_XPSP2);
}
for (StringTable::const_iterator i = files.begin();
i != files.end();
i++) {