summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-05-02 17:16:33 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-05-02 17:16:33 +0000
commit5a94bdd5833fd13bb0404c549be79d51c9a9547f (patch)
tree344b53c673cd550555fbbf8e687bece010ddb67e /protocols/SkypeWeb
parent42cfbc47d3288e23cace4552ceef19456e6d0ca3 (diff)
git-svn-id: http://svn.miranda-ng.org/main/trunk@13381 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r--protocols/SkypeWeb/src/skype_trouter.cpp48
1 files changed, 26 insertions, 22 deletions
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp
index 0f22c3d98f..59eb581d71 100644
--- a/protocols/SkypeWeb/src/skype_trouter.cpp
+++ b/protocols/SkypeWeb/src/skype_trouter.cpp
@@ -158,32 +158,36 @@ void CSkypeProto::TRouterThread(void*)
request->nlc = m_TrouterConnection;
NETLIBHTTPREQUEST *response = request->Send(m_hNetlibUser);
- if (response != NULL)
+ if (response == NULL)
{
- if (response->resultCode == 200)
- {
- if (response->pData)
- {
- char *json = strstr(response->pData, "{");
-
- if (json == NULL)
- continue;
-
- JSONROOT root(json);
- ptrA szBody(mir_t2a(ptrT(json_as_string(json_get(root, "body")))));
- JSONNODE *headers = json_get(root, "headers");
- JSONNODE *body = json_parse(szBody);
- OnTrouterEvent(body, headers);
- }
- }
- else
+ errors++;
+ delete request;
+ continue;
+ }
+
+ if (response->resultCode == 200)
+ {
+ if (response->pData)
{
- SendRequest(new HealthTrouterRequest(ccid), &CSkypeProto::OnHealth);
+ char *json = strstr(response->pData, "{");
+ if (json == NULL)
+ continue;
+
+ JSONROOT root(json);
+ ptrA szBody(mir_t2a(ptrT(json_as_string(json_get(root, "body")))));
+ JSONNODE *headers = json_get(root, "headers");
+ JSONNODE *body = json_parse(szBody);
+ OnTrouterEvent(body, headers);
}
-
- m_TrouterConnection = response->nlc;
- CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)response);
}
+ else
+ {
+ SendRequest(new HealthTrouterRequest(ccid), &CSkypeProto::OnHealth);
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)response);
+ delete request;
+ break;
+ }
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)response);
delete request;
}
m_hTrouterThread = NULL;