From dd979652c29e857fc4bc86742025a10d340046a5 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sun, 11 Aug 2024 17:38:55 +0200 Subject: [PATCH] Handle cancelled file transfer in initial callback. If the client cancelled a file upload in the initial callback, we would incorrectly proceed with the handshake. --- static/protocol.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/protocol.js b/static/protocol.js index cecfa21..54b0b5d 100644 --- a/static/protocol.js +++ b/static/protocol.js @@ -1871,6 +1871,11 @@ ServerConnection.prototype.sendFile = function(id, file) { return; } + if(f.state === 'closed') { + // the client cancelled the transfer + return; + } + sc.transferredFiles[f.fullid()] = f; sc.userMessage('filetransfer', id, { type: 'invite',