summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src/file.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-15 18:21:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-15 18:21:33 +0000
commit683c656dd87e82ec9e2d05f72a7b7e1c7269bfd6 (patch)
treedbd36275d84fe57ae7e60f7765275b1ad1f13ed1 /protocols/AimOscar/src/file.cpp
parenta9fc5c1795cea571927f6ff4ceb8701ffe609ad4 (diff)
ProtoBroadcastAck - unified helper for all protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@4962 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src/file.cpp')
-rw-r--r--protocols/AimOscar/src/file.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp
index 12ef935cd7..8cb4dcc4ca 100644
--- a/protocols/AimOscar/src/file.cpp
+++ b/protocols/AimOscar/src/file.cpp
@@ -197,7 +197,7 @@ int CAimProto::sending_file(file_transfer *ft, HANDLE hServerPacketRecver, NETLI
tSelect.cbSize = sizeof(tSelect);
tSelect.hReadConns[0] = ft->hConn;
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
clock_t lNotify = clock();
for (;;)
@@ -212,13 +212,13 @@ int CAimProto::sending_file(file_transfer *ft, HANDLE hServerPacketRecver, NETLI
if (clock() >= lNotify)
{
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
if (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&tSelect)) break;
lNotify = clock() + 500;
}
}
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
LOG("P2P: Finished sending file bytes.");
_close(fid);
}
@@ -233,7 +233,7 @@ int CAimProto::sending_file(file_transfer *ft, HANDLE hServerPacketRecver, NETLI
LOG("P2P: Buddy says they got the file successfully");
if ((ft->pfts.currentFileNumber + 1) < ft->pfts.totalFiles)
{
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
++ft->pfts.currentFileNumber; ++ft->cf;
if (!setup_next_file_send(ft))
@@ -264,7 +264,7 @@ int CAimProto::sending_file(file_transfer *ft, HANDLE hServerPacketRecver, NETLI
if (Netlib_Send(ft->hConn, (char*)recv_ft, _htons(recv_ft->length), 0) <= 0) break;
ft->pfts.totalProgress += ft->pfts.currentFileProgress;
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
}
}
}
@@ -355,7 +355,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET
ft->pfts.tszCurrentFile = mir_tstrdup(fname);
ResetEvent(ft->hResumeEvent);
- if (sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, ft, (LPARAM)&ft->pfts))
+ if (ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, ft, (LPARAM)&ft->pfts))
WaitForSingleObject(ft->hResumeEvent, INFINITE);
if (ft->pfts.tszCurrentFile)
@@ -389,7 +389,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET
oft->type = _htons(0x0204);
_close(fid);
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
++ft->pfts.currentFileNumber;
ft->pfts.currentFileProgress = 0;
}
@@ -399,7 +399,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET
{
oft->type = _htons(0x0204);
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
++ft->pfts.currentFileNumber;
ft->pfts.currentFileProgress = 0;
}
@@ -437,7 +437,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET
_write(fid, packetRecv.buffer, packetRecv.bytesAvailable);
ft->pfts.currentFileProgress += packetRecv.bytesAvailable;
ft->pfts.totalProgress += packetRecv.bytesAvailable;
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->pfts);
if (ft->pfts.currentFileSize == ft->pfts.currentFileProgress)
{
oft->type = _htons(0x0204);
@@ -456,7 +456,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET
accepted_file = false;
_close(fid);
- sendBroadcast(ft->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
++ft->pfts.currentFileNumber;
ft->pfts.currentFileProgress = 0;
}