summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_auth.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-12 21:27:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-12 21:27:03 +0300
commit3cb3883908e3168e5f955be3143771721614307a (patch)
treee160797994b28577e5fa71a4c790e1670e6f4035 /protocols/MSN/src/msn_auth.cpp
parent6461f17159c83bfaeba1ecbd124ab53551f3e22d (diff)
Netlib_FreeHttpRequest() instead of MS_NETLIB_FREEHTTPREQUESTSTRUCT
Diffstat (limited to 'protocols/MSN/src/msn_auth.cpp')
-rw-r--r--protocols/MSN/src/msn_auth.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp
index 5e6631e242..5501cc4b51 100644
--- a/protocols/MSN/src/msn_auth.cpp
+++ b/protocols/MSN/src/msn_auth.cpp
@@ -286,7 +286,7 @@ bool SkypeToken::Refresh(bool bForce)
}
m_proto->mHttpsTS = clock();
- NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_proto->hNetlibUserHttps, (LPARAM)&nlhr);
+ NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(m_proto->hNetlibUserHttps, &nlhr);
m_proto->mHttpsTS = clock();
if (nlhrReply) {
@@ -312,7 +312,7 @@ bool SkypeToken::Refresh(bool bForce)
bRet=true;
}
}
- CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)nlhrReply);
+ Netlib_FreeHttpRequest(nlhrReply);
} else m_proto->hHttpsConnection = NULL;
return bRet;
}
@@ -795,7 +795,7 @@ bool CMsnProto::RefreshOAuth(const char *pszRefreshToken, const char *pszService
// Query
mHttpsTS = clock();
- NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUserHttps, (LPARAM)&nlhr);
+ NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(hNetlibUserHttps, &nlhr);
mHttpsTS = clock();
if (nlhrReply) {
hHttpsConnection = nlhrReply->nlc;
@@ -816,7 +816,7 @@ bool CMsnProto::RefreshOAuth(const char *pszRefreshToken, const char *pszService
}
}
}
- CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)nlhrReply);
+ Netlib_FreeHttpRequest(nlhrReply);
} else hHttpsConnection = NULL;
return bRet;
}
@@ -1117,7 +1117,7 @@ int CMsnProto::MSN_AuthOAuth(void)
// Get oauth20 login data
nlhr.szUrl = AUTH_URL;
mHttpsTS = clock();
- NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUserHttps, (LPARAM)&nlhr);
+ NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(hNetlibUserHttps, &nlhr);
mHttpsTS = clock();
if (nlhrReply) {
@@ -1142,7 +1142,7 @@ int CMsnProto::MSN_AuthOAuth(void)
nlhr.flags &= (~NLHRF_REDIRECT);
mHttpsTS = clock();
nlhr.nlc = hHttpsConnection;
- NETLIBHTTPREQUEST *nlhrReply2 = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUserHttps, (LPARAM)&nlhr);
+ NETLIBHTTPREQUEST *nlhrReply2 = Netlib_HttpTransaction(hNetlibUserHttps, &nlhr);
mHttpsTS = clock();
if (nlhrReply2) {
char *pszURL=NULL, *pAccessToken, *pEnd;
@@ -1171,14 +1171,14 @@ int CMsnProto::MSN_AuthOAuth(void)
pszURL = param.pszURL;
mir_free(authCookies);
authCookies = nlhr.headers[1].szValue = param.pszCookies;
- CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)nlhrReply2);
+ Netlib_FreeHttpRequest(nlhrReply2);
nlhrReply2 = NULL;
bAskingForAuth = false;
bPassportAuth = false;
}
}
setByte("PassportAuth", bPassportAuth);
- CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)nlhrReply);
+ Netlib_FreeHttpRequest(nlhrReply);
nlhrReply = nlhrReply2;
if (pszURL &&
@@ -1245,8 +1245,9 @@ int CMsnProto::MSN_AuthOAuth(void)
/* Request MappingContainer */
mHttpsTS = clock();
- if (nlhrReply) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)nlhrReply);
- nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUserHttps, (LPARAM)&nlhr);
+ if (nlhrReply)
+ Netlib_FreeHttpRequest(nlhrReply);
+ nlhrReply = Netlib_HttpTransaction(hNetlibUserHttps, &nlhr);
mHttpsTS = clock();
if (nlhrReply) {
hHttpsConnection = nlhrReply->nlc;
@@ -1275,8 +1276,10 @@ int CMsnProto::MSN_AuthOAuth(void)
else hHttpsConnection = NULL;
}
}
- if (nlhrReply) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)nlhrReply);
- } else hHttpsConnection = NULL;
+ if (nlhrReply)
+ Netlib_FreeHttpRequest(nlhrReply);
+ }
+ else hHttpsConnection = NULL;
if (retVal<=0) authSkypeComToken.Clear(); else {
if (bPassportAuth) {