From 87a2660299edd64cbb6f6c92c33683e91a6d187c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 13 Jan 2020 16:48:55 +0300 Subject: Netlib_GetHeader() - handful utility to avoid writing cycles --- protocols/MSN/src/msn_auth.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'protocols/MSN/src') diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index 97b4655b9a..edfd81452f 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -1055,18 +1055,13 @@ int CMsnProto::MSN_AuthOAuth(void) mHttpsTS = clock(); if (nlhrReply2) { char *pszURL = nullptr, *pAccessToken, *pEnd; + hHttpsConnection = nlhrReply2->nlc; - bPassportAuth = true; if (nlhrReply2->resultCode == 302) { /* Extract access_token from Location can be found */ - for (int i = 0; i < nlhrReply2->headersCount; i++) { - if (!mir_strcmpi(nlhrReply2->headers[i].szName, "Location")) { - pszURL = nlhrReply2->headers[i].szValue; - break; - } - } + pszURL = Netlib_GetHeader(nlhrReply2, "Location"); } else { /* There may be a problem with login, i.e. M$ security measures. Open up browser -- cgit v1.2.3