From e004a33b7853108b49f77ced20a460b3c8b78c35 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Jan 2017 19:50:04 +0300 Subject: Discord: - API version is locked to v6; - important fix for handling errors in http requests --- protocols/Discord/src/connection.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'protocols/Discord/src/connection.cpp') 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; } -- cgit v1.2.3