From 66b3785ea500af1f407174493c0f7ace8804f276 Mon Sep 17 00:00:00 2001 From: Asher Baker Date: Tue, 15 Mar 2016 12:06:50 +0000 Subject: [PATCH] Add config option for upload URL --- extension/extension.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/extension/extension.cpp b/extension/extension.cpp index 8416557..bffd0cd 100644 --- a/extension/extension.cpp +++ b/extension/extension.cpp @@ -305,14 +305,17 @@ bool UploadAndDeleteCrashDump(const char *path, char *response, int maxlen) IWebTransfer *xfer = webternet->CreateSession(); 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 (uploaded) { - int responseSize = data.GetSize(); - if (responseSize >= maxlen) responseSize = maxlen - 1; - strncpy(response, data.GetBuffer(), responseSize); - response[responseSize] = '\0'; + int responseSize = data.GetSize(); + if (responseSize >= maxlen) responseSize = maxlen - 1; + strncpy(response, data.GetBuffer(), responseSize); + response[responseSize] = '\0'; } else { g_pSM->Format(response, maxlen, "%s (%d)", xfer->LastErrorMessage(), xfer->LastErrorCode()); }