summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-09-26 18:53:48 +0100
committersin <sin@2f30.org>2014-09-26 18:53:48 +0100
commit2b4ba95048a796cbb0e7a88b4853bd5fe791aa8b (patch)
treed4b939d292d56e13fe77f872fcea7c815bae6f91
parent2ad4bbe2388e8366ee001b7324b259a56d91cede (diff)
Cancel rx transfer if we fail to accept it for whatever reason
-rw-r--r--ratox.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ratox.c b/ratox.c
index 0f816d7..913f8cb 100644
--- a/ratox.c
+++ b/ratox.c
@@ -1219,8 +1219,7 @@ loop(void)
if (tox_file_send_control(tox, f->num, 1, 0,
TOX_FILECONTROL_ACCEPT, NULL, 0) < 0) {
weprintf("Failed to accept transfer from receiver\n");
- close(f->fd[FFILE_OUT]);
- f->fd[FFILE_OUT] = -1;
+ cancelrxtransfer(f);
} else {
printout("Accepted transfer from %s\n",
f->name[0] == '\0' ? "Anonymous" : f->name);