From 9f7ed03494fa22e194e3ee553f3778d68b7ae206 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 16 May 2015 07:36:55 +0000 Subject: Tox: attempt to fix file resuming git-svn-id: http://svn.miranda-ng.org/main/trunk@13613 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_transfer.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'protocols/Tox/src/tox_transfer.cpp') 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); -- cgit v1.2.3