From 044dff97271136c175dc4efa1f90c8b7dcacd19e Mon Sep 17 00:00:00 2001 From: sin Date: Wed, 24 Sep 2014 15:56:25 +0100 Subject: Cancel transfers when we come back after losing connectivity to the DHT --- ratox.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ratox.c b/ratox.c index 5511710..b0c4a45 100644 --- a/ratox.c +++ b/ratox.c @@ -1159,6 +1159,13 @@ loop(void) if (tox_isconnected(tox) == 1) { if (connected == 0) { printout("Connected to DHT\n"); + /* Cancel any pending transfers */ + TAILQ_FOREACH(f, &friendhead, entry) { + if (tox_get_friend_connection_status(tox, f->fid) == 0) { + canceltxtransfer(f); + cancelrxtransfer(f); + } + } connected = 1; } } else { -- cgit v1.2.3