summaryrefslogtreecommitdiff
path: root/updater/xmldata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'updater/xmldata.cpp')
-rw-r--r--updater/xmldata.cpp37
1 files changed, 22 insertions, 15 deletions
diff --git a/updater/xmldata.cpp b/updater/xmldata.cpp
index 2e2e407..d8017a5 100644
--- a/updater/xmldata.cpp
+++ b/updater/xmldata.cpp
@@ -265,25 +265,32 @@ bool UpdateXMLData(const Category cat, const char *redirect_url /*= 0*/, int rec
req.flags |= NLHRF_PERSISTENT | NLHRF_REDIRECT;
NETLIBHTTPREQUEST *resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&req);
- if(etag_hdr.szValue) free(etag_hdr.szValue);
+ if (etag_hdr.szValue) free(etag_hdr.szValue);
- if (!resp) {
+ if (!resp)
+ {
hNetlibHttp = NULL;
- int err = GetLastError();
- if(err) {
- TCHAR buff[512];
- int len = mir_sntprintf(buff, SIZEOF(buff), TranslateT("Failed to download XML data: "));
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, buff + len, 512 - len, 0);
- ShowError(buff);
- //MessageBox(0, buff + len, TranslateT("Updater: Error Downloading XML Data"), MB_OK | MB_ICONWARNING);
- } else {
- ShowError(TranslateT("Failed to download XML data - Response is NULL"));
- //MessageBox(0, TranslateT("Error downloading XML data...\nResponse is NULL"), TranslateT("Updater Error"), MB_OK | MB_ICONWARNING);
- NLog("Failed to download XML data - Response is NULL");
+ if (!Miranda_Terminated())
+ {
+ int err = GetLastError();
+ if (err)
+ {
+ TCHAR buff[512];
+ int len = mir_sntprintf(buff, SIZEOF(buff), TranslateT("Failed to download XML data: "));
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, buff + len, 512 - len, 0);
+ ShowError(buff);
+ //MessageBox(0, buff + len, TranslateT("Updater: Error Downloading XML Data"), MB_OK | MB_ICONWARNING);
+ }
+ else
+ {
+ ShowError(TranslateT("Failed to download XML data - Response is NULL"));
+ //MessageBox(0, TranslateT("Error downloading XML data...\nResponse is NULL"), TranslateT("Updater Error"), MB_OK | MB_ICONWARNING);
+ NLog("Failed to download XML data - Response is NULL");
+ }
}
return LoadOldXMLData(cat, false);
-
- } else if(resp->resultCode == 304) { // 'Not Modified' response
+ }
+ else if (resp->resultCode == 304) { // 'Not Modified' response
hNetlibHttp = resp->nlc;
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
resp = 0;