diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-27 13:48:14 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-27 13:48:14 +0000 |
commit | 346d6c8bba413fa13f31f8acfd808c23a4bbccae (patch) | |
tree | 44d5116e7330e5f87579d4826202557d0dc4851e /protocols/SkypeWeb/src/skype_trouter.cpp | |
parent | 0d289371985e2d099b0de6b8150dbb74fb416e43 (diff) |
SkypeWeb: More fixes & optimizations
git-svn-id: http://svn.miranda-ng.org/main/trunk@14738 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_trouter.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_trouter.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index ca4931d6e0..efc8ab8128 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -88,10 +88,10 @@ void CSkypeProto::OnTrouterPoliciesCreated(const NETLIBHTTPREQUEST *response) TRouter.se,
TRouter.sig,
TRouter.instance,
- TRouter.ccid), &CSkypeProto::OnGetTrouter, NULL);
+ TRouter.ccid), &CSkypeProto::OnGetTrouter);
}
-void CSkypeProto::OnGetTrouter(const NETLIBHTTPREQUEST *response, void *p)
+void CSkypeProto::OnGetTrouter(const NETLIBHTTPREQUEST *response)
{
if (response == NULL || response->pData == NULL)
{
@@ -99,8 +99,6 @@ void CSkypeProto::OnGetTrouter(const NETLIBHTTPREQUEST *response, void *p) return;
}
- bool isHealth = p != NULL;
-
CMStringA data(response->pData);
int iStart = 0;
CMStringA szToken = data.Tokenize(":", iStart).Trim();
@@ -110,7 +108,7 @@ void CSkypeProto::OnGetTrouter(const NETLIBHTTPREQUEST *response, void *p) else
SetEvent(m_hTrouterEvent);
- if (!isHealth)
+ if (time(NULL) - (TRouter.lastRegistrationTime - 120) <= 0)
SendRequest(new RegisterTrouterRequest(m_szTokenSecret, TRouter.url.c_str(), TRouter.sessId.c_str()));
}
@@ -124,7 +122,7 @@ void CSkypeProto::OnHealth(const NETLIBHTTPREQUEST*) TRouter.sig,
TRouter.instance,
TRouter.ccid),
- &CSkypeProto::OnGetTrouter, (void *)1);
+ &CSkypeProto::OnGetTrouter);
}
void CSkypeProto::TRouterThread(void*)
|