Add config option for upload URL

This commit is contained in:
Asher Baker 2016-03-15 12:06:50 +00:00
parent 3085928ca1
commit 66b3785ea5

View File

@ -305,14 +305,17 @@ bool UploadAndDeleteCrashDump(const char *path, char *response, int maxlen)
IWebTransfer *xfer = webternet->CreateSession(); IWebTransfer *xfer = webternet->CreateSession();
xfer->SetFailOnHTTPError(true); xfer->SetFailOnHTTPError(true);
bool uploaded = xfer->PostAndDownload("http://crash.limetech.org/submit", form, &data, NULL); const char *minidumpUrl = g_pSM->GetCoreConfigValue("MinidumpUrl");
if (!minidumpUrl) minidumpUrl = "http://crash.limetech.org/submit";
bool uploaded = xfer->PostAndDownload(minidumpUrl, form, &data, NULL);
if (response) { if (response) {
if (uploaded) { if (uploaded) {
int responseSize = data.GetSize(); int responseSize = data.GetSize();
if (responseSize >= maxlen) responseSize = maxlen - 1; if (responseSize >= maxlen) responseSize = maxlen - 1;
strncpy(response, data.GetBuffer(), responseSize); strncpy(response, data.GetBuffer(), responseSize);
response[responseSize] = '\0'; response[responseSize] = '\0';
} else { } else {
g_pSM->Format(response, maxlen, "%s (%d)", xfer->LastErrorMessage(), xfer->LastErrorCode()); g_pSM->Format(response, maxlen, "%s (%d)", xfer->LastErrorMessage(), xfer->LastErrorCode());
} }