diff options
author | Piotr Piastucki <leech.miranda@gmail.com> | 2016-03-24 19:02:54 +0000 |
---|---|---|
committer | Piotr Piastucki <leech.miranda@gmail.com> | 2016-03-24 19:02:54 +0000 |
commit | 49df455909f265452893494c7ffedf2298d6206d (patch) | |
tree | 674e98178e930839d08fc3b1a5d5ab1855b19643 /protocols/MSN/src/msn_auth.cpp | |
parent | db183102066ebd069f7668b06b6cd58812674e81 (diff) |
MSN: Only loading OpenSSL lib for login, so that there is no waste of memory if tokens are already present
Added logging for skylogin.
git-svn-id: http://svn.miranda-ng.org/main/trunk@16536 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_auth.cpp')
-rw-r--r-- | protocols/MSN/src/msn_auth.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index 9bac895468..fb6967929f 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -326,6 +326,19 @@ const char *SkypeToken::XSkypetoken() }
return NULL;
}
+
+
+int debugLogSkyLoginA(void *Pproto, LPCSTR szFormat, ...)
+{
+ CMsnProto *pProto = (CMsnProto *)Pproto;
+
+ va_list args;
+ va_start(args, szFormat);
+ ProtoLogA(pProto, szFormat, args);
+ va_end(args);
+ return 1;
+}
+
// Performs the MSN Passport login via TLS
int CMsnProto::MSN_GetPassportAuth(void)
{
@@ -653,6 +666,8 @@ CMStringA CMsnProto::HotmailLogin(const char* url) int CMsnProto::MSN_SkypeAuth(const char *pszNonce, char *pszUIC)
{
int iRet = -1;
+
+ if (g_hOpenssl == NULL) g_hOpenssl = LoadLibraryA("libeay32.dll");
if (g_hOpenssl == NULL)
return iRet;
@@ -662,6 +677,7 @@ int CMsnProto::MSN_SkypeAuth(const char *pszNonce, char *pszUIC) iRet = 0;
char szPassword[100];
+ SkyLogin_SetLogFunction(hLogin, debugLogSkyLoginA, this);
if (!db_get_static(NULL, m_szModuleName, "Password", szPassword, sizeof(szPassword))) {
if (SkyLogin_LoadCredentials(hLogin, MyOptions.szEmail) ||
SkyLogin_PerformLogin(hLogin, MyOptions.szEmail, szPassword))
@@ -686,6 +702,7 @@ int CMsnProto::MSN_SkypeAuth(const char *pszNonce, char *pszUIC) int CMsnProto::LoginSkypeOAuth(const char *pRefreshToken)
{
int iRet = -1;
+ if (g_hOpenssl == NULL) g_hOpenssl = LoadLibraryA("libeay32.dll");
if (g_hOpenssl == NULL)
return iRet;
@@ -693,6 +710,7 @@ int CMsnProto::LoginSkypeOAuth(const char *pRefreshToken) SkyLogin hLogin = SkyLogin_Init();
if (hLogin) {
char szLoginToken[1024];
+ SkyLogin_SetLogFunction(hLogin, debugLogSkyLoginA, this);
if (RefreshOAuth(pRefreshToken, "service::login.skype.com::MBI_SSL", szLoginToken) &&
SkyLogin_PerformLoginOAuth(hLogin, szLoginToken))
{
|