From 1a2d6908933edd5b1c1819f94ec873049912cd4e Mon Sep 17 00:00:00 2001 From: Alexander Gluzsky Date: Tue, 19 Apr 2016 20:29:51 +0000 Subject: aim: "clientlogin": minor fixes (still not working) git-svn-id: http://svn.miranda-ng.org/main/trunk@16721 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/connection.cpp | 15 ++++++++++++--- protocols/AimOscar/src/stdafx.h | 6 +++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/protocols/AimOscar/src/connection.cpp b/protocols/AimOscar/src/connection.cpp index 1a9b347902..76338e62cb 100755 --- a/protocols/AimOscar/src/connection.cpp +++ b/protocols/AimOscar/src/connection.cpp @@ -200,7 +200,7 @@ void fill_session_url(CMStringA &buf, CMStringA &token, CMStringA &secret, time_ */ CMStringA query_string; - query_string.Format("a=%s&distId=%d&f=xml&k=%s&ts=%llu&useTLS=%d", token, AIM_DEFAULT_DISTID, AIM_DEFAULT_CLIENT_KEY, hosttime, (int)encryption); + query_string.Format("a=%s&distId=%s&f=xml&k=%s&ts=%llu&useTLS=%d", token, AIM_DEFAULT_DISTID, AIM_DEFAULT_CLIENT_KEY, hosttime, (int)encryption); BYTE session_key[MIR_SHA256_HASH_SIZE], signature[MIR_SHA256_HASH_SIZE]; mir_hmac_sha256(session_key, (BYTE*)password, mir_strlen(password), (BYTE*)secret.GetString(), secret.GetLength()); @@ -301,10 +301,19 @@ void CAimProto::aim_connection_clientlogin(void) // reuse NETLIBHTTPREQUEST req.requestType = REQUEST_GET; req.pData = NULL; + req.flags |= NLHRF_MANUALHOST; + //req.flags &= ~(NLHRF_GENERATEHOST | NLHRF_SMARTREMOVEHOST | NLHRF_REMOVEHOST); req.dataLength = 0; - req.headersCount = 0; //additional headers disabled + req.headersCount = 4; //additional headers disabled req.szUrl = url.GetBuffer(); - resp = CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req); + { + NETLIBHTTPHEADER headers2[] = { + { "Host", "api.oscar.aol.com" }, + }; + req.headers = headers2; + + resp = CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req); + } if (!resp || !resp->dataLength) { // TODO: handle error diff --git a/protocols/AimOscar/src/stdafx.h b/protocols/AimOscar/src/stdafx.h index 8adc98a32f..59d7044297 100755 --- a/protocols/AimOscar/src/stdafx.h +++ b/protocols/AimOscar/src/stdafx.h @@ -169,13 +169,13 @@ along with this program. If not, see . #define AIM_LOGIN_URL "https://api.screenname.aol.com/auth/clientLogin" #define AIM_SESSION_URL "https://api.oscar.aol.com/aim/startOSCARSession" #define AIM_DEFAULT_CLIENT_KEY "ma15d7JTxbmVG-RP" //this one from libpurple, i am not able to create one, sorry guys -#define AIM_DEFAULT_DISTID 0x00000611 //this one from libpurple, i am not able to create one, sorry guys +#define AIM_DEFAULT_DISTID "1553" //this one from libpurple, i am not able to create one, sorry guys + + #define AIM_DEFAULT_SERVER "login.oscar.aol.com" -//#define AIM_DEFAULT_SERVER_SSL "slogin.oscar.aol.com" #define AIM_PROXY_SERVER "ars.oscar.aol.com" #define AIM_DEFAULT_PORT 5190 -//#define AIM_DEFAULT_SSL_PORT 5190 //Some Defaults for various things #define DEFAULT_KEEPALIVE_TIMER 39 // secs -- cgit v1.2.3