diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-11 19:50:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-11 19:50:04 +0300 |
commit | e004a33b7853108b49f77ced20a460b3c8b78c35 (patch) | |
tree | 18bdffdf6db026cd108a337c1f15dcf89c351d9d /protocols/Discord/src/connection.cpp | |
parent | 499aee4b2b43b2835a4fb13410cd195fb5a4311a (diff) |
Discord:
- API version is locked to v6;
- important fix for handling errors in http requests
Diffstat (limited to 'protocols/Discord/src/connection.cpp')
-rw-r--r-- | protocols/Discord/src/connection.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/protocols/Discord/src/connection.cpp b/protocols/Discord/src/connection.cpp index d3c44b2d9a..969e85fb05 100644 --- a/protocols/Discord/src/connection.cpp +++ b/protocols/Discord/src/connection.cpp @@ -33,8 +33,10 @@ void CDiscordProto::ExecuteRequest(AsyncHttpRequest *pReq) } } - pReq->flags |= NLHRF_PERSISTENT; - pReq->nlc = m_hAPIConnection; + if (pReq->m_bMainSite) { + pReq->flags |= NLHRF_PERSISTENT; + pReq->nlc = m_hAPIConnection; + } debugLogA("Executing request #%d:\n%s", pReq->m_iReqNum, pReq->szUrl); NETLIBHTTPREQUEST *reply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)pReq); @@ -49,11 +51,11 @@ void CDiscordProto::ExecuteRequest(AsyncHttpRequest *pReq) else { debugLogA("Request %d failed", pReq->m_iReqNum); - if (IsStatusConnecting(m_iStatus)) - ConnectionFailed(LOGINERR_NONETWORK); - else - ShutdownSession(); - m_hAPIConnection = NULL; + if (pReq->m_bMainSite) { + if (IsStatusConnecting(m_iStatus)) + ConnectionFailed(LOGINERR_NONETWORK); + m_hAPIConnection = NULL; + } } delete pReq; } |