diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-20 21:23:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-20 21:23:22 +0300 |
commit | dd6ac172c4f814fa4b5ace6caca80d00d7e01ac8 (patch) | |
tree | 805abd69e64f8e1f268e6415689de8742cac2215 /protocols/Gadu-Gadu/src/filetransfer.cpp | |
parent | 79d99837e0fefa32d695dba7e2a13b8a42f39da2 (diff) |
bunch of useless threads replaced with a call of ProtoBroadcastAsync
Diffstat (limited to 'protocols/Gadu-Gadu/src/filetransfer.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/filetransfer.cpp | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index 14be05e395..dac2149fb1 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -88,39 +88,12 @@ void GaduProto::dccconnect(uin_t uin) gg_LeaveCriticalSection(&ft_mutex, "dccconnect", 36, 1, "ft_mutex", 1);
}
-struct ftfaildata
-{
- MCONTACT hContact;
- HANDLE hProcess;
-};
-
-//////////////////////////////////////////////////////////
-// THREAD: File transfer fail
-//
-void __cdecl GaduProto::ftfailthread(void *param)
-{
- struct ftfaildata *ft = (struct ftfaildata *)param;
- debugLogA("ftfailthread(): started. Sending failed file transfer.");
- gg_sleep(100, FALSE, "ftfailthread", 102, 1);
- ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft->hProcess, 0);
- free(ft);
- debugLogA("ftfailthread(): end.");
-}
-
HANDLE ftfail(GaduProto *gg, MCONTACT hContact)
{
- ftfaildata *ft = (ftfaildata*)malloc(sizeof(struct ftfaildata));
-#ifdef DEBUGMODE
- gg->debugLogA("ftfail(): Failing file transfer...");
-#endif
srand(time(0));
- ft->hProcess = (HANDLE)rand();
- ft->hContact = hContact;
-#ifdef DEBUGMODE
- gg->debugLogA("ftfail(): ForkThread 5 GaduProto::ftfailthread");
-#endif
- gg->ForkThread(&GaduProto::ftfailthread, ft);
- return ft->hProcess;
+ HANDLE hProcess = (HANDLE)rand();
+ gg->ProtoBroadcastAsync(hContact, ACKTYPE_FILE, ACKRESULT_FAILED, hProcess);
+ return hProcess;
}
// Info refresh min time (msec) / half-sec
|