summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_ssl.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-16 18:15:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-16 18:15:16 +0000
commit8a59f88f48312eb877347a233b0a6ec11c9ab550 (patch)
tree8c9724efe668b5744bd37fe6ae3b45330a53b742 /protocols/MSN/src/msn_ssl.cpp
parent8148930684c823e526ab8092b33c129a8b17db74 (diff)
MSN protocol's death-scream
git-svn-id: http://svn.miranda-ng.org/main/trunk@10998 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_ssl.cpp')
-rw-r--r--protocols/MSN/src/msn_ssl.cpp39
1 files changed, 17 insertions, 22 deletions
diff --git a/protocols/MSN/src/msn_ssl.cpp b/protocols/MSN/src/msn_ssl.cpp
index 42b324655c..b4f0402e4b 100644
--- a/protocols/MSN/src/msn_ssl.cpp
+++ b/protocols/MSN/src/msn_ssl.cpp
@@ -28,7 +28,7 @@ char* CMsnProto::getSslResult(char** parUrl, const char* parAuthInfo, const char
mHttpsTS = clock();
char* result = NULL;
- NETLIBHTTPREQUEST nlhr = {0};
+ NETLIBHTTPREQUEST nlhr = { 0 };
// initialize the netlib request
nlhr.cbSize = sizeof(nlhr);
@@ -44,28 +44,26 @@ char* CMsnProto::getSslResult(char** parUrl, const char* parAuthInfo, const char
#endif
nlhr.headersCount = 4;
- nlhr.headers=(NETLIBHTTPHEADER*)alloca(sizeof(NETLIBHTTPHEADER) * (nlhr.headersCount + 5));
- nlhr.headers[0].szName = "User-Agent";
+ nlhr.headers = (NETLIBHTTPHEADER*)alloca(sizeof(NETLIBHTTPHEADER) * (nlhr.headersCount + 5));
+ nlhr.headers[0].szName = "User-Agent";
nlhr.headers[0].szValue = (char*)MSN_USER_AGENT;
- nlhr.headers[1].szName = "Accept";
+ nlhr.headers[1].szName = "Accept";
nlhr.headers[1].szValue = "text/*";
- nlhr.headers[2].szName = "Content-Type";
+ nlhr.headers[2].szName = "Content-Type";
nlhr.headers[2].szValue = "text/xml; charset=utf-8";
- nlhr.headers[3].szName = "Cache-Control";
+ nlhr.headers[3].szName = "Cache-Control";
nlhr.headers[3].szValue = "no-cache";
- if (hdrs)
- {
+ if (hdrs) {
unsigned count = 0;
char* hdrprs = NEWSTR_ALLOCA(hdrs);
- for (;;)
- {
+ for (;;) {
char* fnd = strchr(hdrprs, ':');
if (fnd == NULL) break;
*fnd = 0;
fnd += 2;
- nlhr.headers[nlhr.headersCount].szName = hdrprs;
+ nlhr.headers[nlhr.headersCount].szName = hdrprs;
nlhr.headers[nlhr.headersCount].szValue = fnd;
fnd = strchr(fnd, '\r');
@@ -78,15 +76,13 @@ char* CMsnProto::getSslResult(char** parUrl, const char* parAuthInfo, const char
// download the page
NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION,
- (WPARAM)hNetlibUserHttps,(LPARAM)&nlhr);
+ (WPARAM)hNetlibUserHttps, (LPARAM)&nlhr);
- if (nlhrReply)
- {
+ if (nlhrReply) {
hHttpsConnection = nlhrReply->nlc;
status = nlhrReply->resultCode;
- if (nlhrReply->szUrl)
- {
+ if (nlhrReply->szUrl) {
mir_free(*parUrl);
*parUrl = nlhrReply->szUrl;
nlhrReply->szUrl = NULL;
@@ -109,7 +105,7 @@ char* CMsnProto::getSslResult(char** parUrl, const char* parAuthInfo, const char
bool CMsnProto::getMyAvatarFile(char *url, TCHAR *fname)
{
- NETLIBHTTPREQUEST nlhr = {0};
+ NETLIBHTTPREQUEST nlhr = { 0 };
bool result = true;
// initialize the netlib request
@@ -119,16 +115,15 @@ bool CMsnProto::getMyAvatarFile(char *url, TCHAR *fname)
nlhr.szUrl = url;
nlhr.headersCount = 1;
- nlhr.headers=(NETLIBHTTPHEADER*)alloca(sizeof(NETLIBHTTPHEADER) * nlhr.headersCount);
- nlhr.headers[0].szName = "User-Agent";
+ nlhr.headers = (NETLIBHTTPHEADER*)alloca(sizeof(NETLIBHTTPHEADER) * nlhr.headersCount);
+ nlhr.headers[0].szName = "User-Agent";
nlhr.headers[0].szValue = (char*)MSN_USER_AGENT;
// download the page
NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION,
- (WPARAM)hNetlibUserHttps,(LPARAM)&nlhr);
+ (WPARAM)hNetlibUserHttps, (LPARAM)&nlhr);
- if (nlhrReply)
- {
+ if (nlhrReply) {
if (nlhrReply->resultCode == 200 && nlhrReply->dataLength)
MSN_SetMyAvatar(fname, nlhrReply->pData, nlhrReply->dataLength);
else