diff options
author | George Hazan <ghazan@miranda.im> | 2019-07-24 14:30:13 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-07-24 14:30:13 +0300 |
commit | 103de9c164934b2393dfcba7011625f90c8a2097 (patch) | |
tree | f7a4a09afe29398f3b7605d7d0db264638a18150 /plugins/CrashDumper | |
parent | 541eab20530165d10592a9fda590f435c6a8b4be (diff) |
NLHR_PTR - smart pointers make better code
Diffstat (limited to 'plugins/CrashDumper')
-rw-r--r-- | plugins/CrashDumper/src/upload.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index 746567bd28..1e212aa391 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -122,10 +122,8 @@ bool InternetDownloadFile(const char *szUrl, VerTrnsfr* szReq) while (result == 0xBADBAD) {
// download the page
- NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(hNetlibUser, &nlhr);
+ NLHR_PTR nlhrReply(Netlib_HttpTransaction(hNetlibUser, &nlhr));
if (nlhrReply) {
- int i;
-
// if the recieved code is 200 OK
switch (nlhrReply->resultCode) {
case 200:
@@ -156,7 +154,7 @@ bool InternetDownloadFile(const char *szUrl, VerTrnsfr* szReq) case 307:
// get the url for the new location and save it to szInfo
// look for the reply header "Location"
- for (i = 0; i < nlhrReply->headersCount; i++) {
+ for (int i = 0; i < nlhrReply->headersCount; i++) {
if (!mir_strcmp(nlhrReply->headers[i].szName, "Location")) {
size_t rlen = 0;
if (nlhrReply->headers[i].szValue[0] == '/') {
@@ -188,8 +186,6 @@ bool InternetDownloadFile(const char *szUrl, VerTrnsfr* szReq) result = 1;
ShowMessage(0, TranslateT("Cannot upload Version Info. Host unreachable."));
}
-
- Netlib_FreeHttpRequest(nlhrReply);
}
mir_free(szRedirUrl);
|