summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-09-24 15:56:25 +0100
committersin <sin@2f30.org>2014-09-24 15:56:25 +0100
commit044dff97271136c175dc4efa1f90c8b7dcacd19e (patch)
tree217045f3bca8b7ca29e00715d89ffd2dc2fc3416 /ratox.c
parente020b1e9369fc6aaf9f600ab5b1bf93c1235e503 (diff)
Cancel transfers when we come back after losing connectivity to the DHT
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c7
1 files changed, 7 insertions, 0 deletions
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 {