From 03a1ac4f699af179a1870a1bf6ab33a47aa68351 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 15 Apr 2021 15:57:24 +0200 Subject: mod_tls: Bail out if session got destroyed while sending Can happen in case opportunistic_writes is enabled and the session got destroyed while writing that tag. Thanks Ge0rG --- plugins/mod_tls.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index d6198522..83d4af3d 100644 --- a/plugins/mod_tls.lua +++ b/plugins/mod_tls.lua @@ -121,6 +121,7 @@ module:hook("stanza/urn:ietf:params:xml:ns:xmpp-tls:starttls", function(event) local origin = event.origin; if can_do_tls(origin) then (origin.sends2s or origin.send)(starttls_proceed); + if origin.destroyed then return end origin:reset_stream(); origin.conn:starttls(origin.ssl_ctx); origin.log("debug", "TLS negotiation started for %s...", origin.type); -- cgit v1.2.3