From cac4fe1a1a81d3262af46be94a85f69b81021ccc Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 2 May 2015 17:28:01 +0000 Subject: SkypeWeb: Not register trouter arfer health. git-svn-id: http://svn.miranda-ng.org/main/trunk@13382 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_proto.h | 2 +- protocols/SkypeWeb/src/skype_trouter.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 13b0dc16af..cc9668083d 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -150,7 +150,7 @@ private: void OnCreateTrouter(const NETLIBHTTPREQUEST *response); void OnTrouterPoliciesCreated(const NETLIBHTTPREQUEST *response); - void OnGetTrouter(const NETLIBHTTPREQUEST *response); + void OnGetTrouter(const NETLIBHTTPREQUEST *response, void *p); void OnHealth(const NETLIBHTTPREQUEST *response); void OnTrouterEvent(JSONNODE *body, JSONNODE *headers); void __cdecl CSkypeProto::TRouterThread(void*); diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index 59eb581d71..0546cda1b5 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -58,21 +58,25 @@ void CSkypeProto::OnTrouterPoliciesCreated(const NETLIBHTTPREQUEST *response) st, se, sig, getStringA("Trouter_instance"), getStringA("Trouter_ccid") - ), &CSkypeProto::OnGetTrouter); + ), &CSkypeProto::OnGetTrouter, (void *)false); } -void CSkypeProto::OnGetTrouter(const NETLIBHTTPREQUEST *response) +void CSkypeProto::OnGetTrouter(const NETLIBHTTPREQUEST *response, void *p) { if (response == NULL || response->pData == NULL) return; + + bool isHealth = (bool)p; + CMStringA data(response->pData); int iStart = 0; CMStringA szToken = data.Tokenize(":", iStart).Trim(); setString("Trouter_SessId", szToken); m_hTrouterThread = ForkThreadEx(&CSkypeProto::TRouterThread, 0, NULL); - SendRequest(new RegisterTrouterRequest(TokenSecret, ptrA(getStringA("Trouter_url")), szToken)); + if (!isHealth) + SendRequest(new RegisterTrouterRequest(TokenSecret, ptrA(getStringA("Trouter_url")), szToken)); } void CSkypeProto::OnHealth(const NETLIBHTTPREQUEST*) @@ -86,7 +90,7 @@ void CSkypeProto::OnHealth(const NETLIBHTTPREQUEST*) ptrA sessId(getStringA("Trouter_SessId")); ptrA sig(getStringA("Trouter_sig")); - SendRequest(new GetTrouterRequest(socketIo, connId, st, se, sig, instance, ccid), &CSkypeProto::OnGetTrouter); + SendRequest(new GetTrouterRequest(socketIo, connId, st, se, sig, instance, ccid), &CSkypeProto::OnGetTrouter, (void *)true); } void CSkypeProto::OnTrouterEvent(JSONNODE *body, JSONNODE *headers) -- cgit v1.2.3