diff options
author | George Hazan <ghazan@miranda.im> | 2020-08-25 18:42:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-08-25 18:42:48 +0300 |
commit | 0663b8bd76750f161e7ec15bad675a33b31981ca (patch) | |
tree | dbcfd573dfdfe091b149105e1d957a0da33d9a97 /protocols/SkypeWeb/src | |
parent | 4db851b2ce1f5d424f9cab49daf01c8f159734bd (diff) |
fixes #2522 (SkypeWeb: valid errorcode 401 processing after /endpointCreated)
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 2cf41db7c2..12b058b17c 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -118,10 +118,8 @@ void CSkypeProto::OnLoginSuccess() void CSkypeProto::OnEndpointCreated(NETLIBHTTPREQUEST *response, AsyncHttpRequest*)
{
- if (!IsStatusConnecting(m_iStatus))
- return;
-
- m_iStatus++;
+ if (IsStatusConnecting(m_iStatus))
+ m_iStatus++;
if (response == nullptr) {
debugLogA(__FUNCTION__ ": failed to get create endpoint");
@@ -140,7 +138,7 @@ void CSkypeProto::OnEndpointCreated(NETLIBHTTPREQUEST *response, AsyncHttpReques if (auto *hdr = Netlib_GetHeader(response, "Location"))
g_plugin.szDefaultServer = GetServerFromUrl(hdr);
PushRequest(new CreateEndpointRequest(this));
- break;
+ return;
case 401: // unauthorized
if (auto *szStatus = Netlib_GetHeader(response, "StatusText"))
@@ -157,12 +155,13 @@ void CSkypeProto::OnEndpointCreated(NETLIBHTTPREQUEST *response, AsyncHttpReques return;
}
- if (m_iStatus++ > SKYPE_MAX_CONNECT_RETRIES) {
- debugLogA(__FUNCTION__ ": failed to create endpoint (too many connect retries)");
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
- SetStatus(ID_STATUS_OFFLINE);
- return;
- }
+ if (IsStatusConnecting(m_iStatus))
+ if (m_iStatus++ > SKYPE_MAX_CONNECT_RETRIES) {
+ debugLogA(__FUNCTION__ ": failed to create endpoint (too many connect retries)");
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
+ SetStatus(ID_STATUS_OFFLINE);
+ return;
+ }
if (auto *hdr = Netlib_GetHeader(response, "Set-RegistrationToken")) {
CMStringA szValue = hdr;
|