diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-16 18:15:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-16 18:15:16 +0000 |
commit | 8a59f88f48312eb877347a233b0a6ec11c9ab550 (patch) | |
tree | 8c9724efe668b5744bd37fe6ae3b45330a53b742 /protocols/MSN/src/msn_http.cpp | |
parent | 8148930684c823e526ab8092b33c129a8b17db74 (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_http.cpp')
-rw-r--r-- | protocols/MSN/src/msn_http.cpp | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/protocols/MSN/src/msn_http.cpp b/protocols/MSN/src/msn_http.cpp index ae2f18cdf2..7077c66838 100644 --- a/protocols/MSN/src/msn_http.cpp +++ b/protocols/MSN/src/msn_http.cpp @@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. static ThreadData* FindThreadConn(HANDLE hConn)
{
- ThreadData* res = NULL;
+ ThreadData *res = NULL;
for (int i = 0; i < g_Instances.getCount() && res == NULL; ++i)
res = g_Instances[i].MSN_GetThreadByConnection(hConn);
@@ -38,7 +38,7 @@ static ThreadData* FindThreadConn(HANDLE hConn) int msn_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION* nloc, NETLIBHTTPREQUEST* nlhr)
{
- NETLIBHTTPPROXYINFO nlhpi = {0};
+ NETLIBHTTPPROXYINFO nlhpi = { 0 };
nlhpi.cbSize = sizeof(nlhpi);
nlhpi.szHttpGetUrl = NULL;
nlhpi.szHttpPostUrl = "messenger.hotmail.com";
@@ -54,9 +54,8 @@ int msn_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION* nloc, NETLIBHTTPREQU int msn_httpGatewayWrapSend(HANDLE hConn, PBYTE buf, int len, int flags, MIRANDASERVICE pfnNetlibSend)
{
- ThreadData* T = FindThreadConn(hConn);
- if (T != NULL)
- {
+ ThreadData *T = FindThreadConn(hConn);
+ if (T != NULL) {
if (T->sessionClosed)
return SOCKET_ERROR;
@@ -76,18 +75,17 @@ PBYTE msn_httpGatewayUnwrapRecv(NETLIBHTTPREQUEST* nlhr, PBYTE buf, int len, int {
*outBufLen = len;
- ThreadData* T = FindThreadConn(nlhr->nlc);
- if (T == NULL) return buf;
+ ThreadData *T = FindThreadConn(nlhr->nlc);
+ if (T == NULL)
+ return buf;
bool isSessionClosed = true;
bool isMsnPacket = false;
- if (nlhr->resultCode == 200)
- {
+ if (nlhr->resultCode == 200) {
char *xMsgr = NULL, *xHost = NULL;
- for (int i=0; i < nlhr->headersCount; i++)
- {
+ for (int i = 0; i < nlhr->headersCount; i++) {
NETLIBHTTPHEADER& tHeader = nlhr->headers[i];
if (_stricmp(tHeader.szName, "X-MSN-Messenger") == 0)
xMsgr = tHeader.szValue;
@@ -96,8 +94,7 @@ PBYTE msn_httpGatewayUnwrapRecv(NETLIBHTTPREQUEST* nlhr, PBYTE buf, int len, int }
- if (xMsgr)
- {
+ if (xMsgr) {
isMsnPacket = true;
if (strstr(xMsgr, "Session=close") == 0)
@@ -109,20 +106,17 @@ PBYTE msn_httpGatewayUnwrapRecv(NETLIBHTTPREQUEST* nlhr, PBYTE buf, int len, int }
T->sessionClosed |= isSessionClosed;
- if (isSessionClosed && buf == NULL)
- {
+ if (isSessionClosed && buf == NULL) {
*outBufLen = 0;
buf = (PBYTE)mir_alloc(1);
*buf = 0;
}
- else if (buf == NULL && len == 0)
- {
+ else if (buf == NULL && len == 0) {
*outBufLen = 1;
buf = (PBYTE)mir_alloc(1);
*buf = 0;
}
- else if (!isMsnPacket)
- {
+ else if (!isMsnPacket) {
*outBufLen = 0;
*buf = 0;
}
|