From 5b96fde6e45f0cde5a6c01abb1bd7ca37a41a2ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Fri, 29 May 2020 16:17:02 -0400
Subject: [PATCH] p2p: stop onStateChange when cancelled

Change-Id: Iceb7bb4ec8e710928b9399a75122db2f837d5491
---
 src/jamidht/p2p.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/jamidht/p2p.cpp b/src/jamidht/p2p.cpp
index 53c7d9819d..700012263a 100644
--- a/src/jamidht/p2p.cpp
+++ b/src/jamidht/p2p.cpp
@@ -417,6 +417,7 @@ private:
                     JAMI_WARN() << "TLS connection failure from peer " << peer_.toString();
                 ice->cancelOperations(); // This will stop current PeerChannel operations
                 cancel();
+                return false;
             } else if (state == tls::TlsSessionState::ESTABLISHED) {
                 // Connected!
                 connected_ = true;
-- 
GitLab