summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/icq_filerequests.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-14 13:46:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-14 13:46:12 +0000
commit18ef6358ffbf73021a958baefb6c4be4054e0042 (patch)
tree283b0b988a61b9297162d26659f38911cb14704b /protocols/IcqOscarJ/src/icq_filerequests.cpp
parentca5a8922da1fe6e9de0f24e669c9321d5afa622a (diff)
- debug prints uncommented to log packet codes etc.
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@9793 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/icq_filerequests.cpp')
-rw-r--r--protocols/IcqOscarJ/src/icq_filerequests.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp
index fec6fe6e0a..afb4d94bcc 100644
--- a/protocols/IcqOscarJ/src/icq_filerequests.cpp
+++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp
@@ -34,25 +34,21 @@ void CIcqProto::handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie,
WORD wFilenameLength;
filetransfer* ft;
-
// Find the filetransfer that belongs to this response
- if (!FindCookie(dwCookie, &hCookieContact, (void**)&ft))
- {
+ if (!FindCookie(dwCookie, &hCookieContact, (void**)&ft)) {
NetLog_Direct("Error: Received unexpected file transfer request response");
return;
}
FreeCookie(dwCookie);
- if (hCookieContact != HContactFromUIN(dwUin, NULL))
- {
+ if (hCookieContact != HContactFromUIN(dwUin, NULL)) {
NetLog_Direct("Error: UINs do not match in file transfer request response");
return;
}
// If status != 0, a request has been denied
- if (wStatus != 0)
- {
+ if (wStatus != 0) {
NetLog_Direct("File transfer denied by %u.", dwUin);
ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_DENIED, (HANDLE)ft, 0);
@@ -61,8 +57,7 @@ void CIcqProto::handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie,
return;
}
- if (wLen < 6)
- { // sanity check
+ if (wLen < 6) { // sanity check
NetLog_Direct("Ignoring malformed file transfer request response");
return;
}
@@ -78,18 +73,16 @@ void CIcqProto::handleFileAck(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCookie,
// Filename
unpackLEWord(&buf, &wFilenameLength);
- if (wFilenameLength > 0)
- {
+ if (wFilenameLength > 0) {
if (wFilenameLength > wLen - 2)
wFilenameLength = wLen - 2;
- pszFileName = (char*)_alloca(wFilenameLength+1);
+ pszFileName = (char*)_alloca(wFilenameLength + 1);
unpackString(&buf, pszFileName, wFilenameLength);
pszFileName[wFilenameLength] = '\0';
}
wLen = wLen - 2 - wFilenameLength;
- if (wLen >= 4)
- { // Total filesize
+ if (wLen >= 4) { // Total filesize
unpackLEDWord(&buf, &dwFileSize);
wLen -= 4;
}
@@ -167,7 +160,7 @@ void CIcqProto::handleFileRequest(PBYTE buf, WORD wLen, DWORD dwUin, DWORD dwCoo
// Send chain event
TCHAR* ptszFileName = mir_utf8decodeT(pszFileName);
- PROTORECVFILET pre = {0};
+ PROTORECVFILET pre = { 0 };
pre.flags = PREF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
@@ -194,14 +187,12 @@ void CIcqProto::icq_CancelFileTransfer(MCONTACT hContact, filetransfer* ft)
if (FindCookieByData(ft, &dwCookie, NULL))
FreeCookie(dwCookie); /* this bit stops a send that's waiting for acceptance */
- if (IsValidFileTransfer(ft))
- { // Transfer still out there, end it
+ if (IsValidFileTransfer(ft)) { // Transfer still out there, end it
NetLib_CloseConnection(&ft->hConnection, FALSE);
ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
- if (!FindFileTransferDC(ft))
- { // Release orphan structure only
+ if (!FindFileTransferDC(ft)) { // Release orphan structure only
SafeReleaseFileTransfer((void**)&ft);
}
}