summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_transfer.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-05-16 07:36:55 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-05-16 07:36:55 +0000
commit9f7ed03494fa22e194e3ee553f3778d68b7ae206 (patch)
tree82723009792acaddd15aeac0d036da28fb944e9f /protocols/Tox/src/tox_transfer.cpp
parent2a88f2274cd799a5478905e47d0f4d0e791440b4 (diff)
Tox: attempt to fix file resuming
git-svn-id: http://svn.miranda-ng.org/main/trunk@13613 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_transfer.cpp')
-rw-r--r--protocols/Tox/src/tox_transfer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp
index cc215c173e..5a1844383b 100644
--- a/protocols/Tox/src/tox_transfer.cpp
+++ b/protocols/Tox/src/tox_transfer.cpp
@@ -269,6 +269,11 @@ void CToxProto::OnFileSendData(Tox*, uint32_t friendNumber, uint32_t fileNumber,
TOX_ERR_FILE_SEND_CHUNK error;
if (!tox_file_send_chunk(proto->tox, friendNumber, fileNumber, position, data, length, &error))
{
+ if (error == TOX_ERR_FILE_SEND_CHUNK_FRIEND_NOT_CONNECTED)
+ {
+ mir_free(data);
+ return;
+ }
proto->debugLogA(__FUNCTION__": failed to send file chunk (%d)", error);
proto->ProtoBroadcastAck(transfer->pfts.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)transfer, 0);
tox_file_control(proto->tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, NULL);