From 5b4624137d81ba3bf6a7d2188cee5979553d19d3 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 11 Mar 2025 18:37:16 +0000 Subject: mod_c2s: Code formatting change Although we do sometimes use single-line if blocks, I'm expanding this one to make it easier to compare with the duplicated (but modified) code in mod_websocket that we plan to de-duplicate one day. --- plugins/mod_c2s.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index a9417368..c1fbdb9e 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -252,12 +252,16 @@ local function session_close(session, reason) if not session.destroyed then session.log("warn", "Failed to receive a stream close response, closing connection anyway..."); sm_destroy_session(session, reason_text); - if conn then conn:close(); end + if conn then + conn:close(); + end end end); else sm_destroy_session(session, reason_text); - if conn then conn:close(); end + if conn then + conn:close(); + end end else local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason; -- cgit v1.2.3