Diff

plugins/mod_c2s.lua @ 13764:667a58e74fd9 13.0

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.
author Matthew Wild <mwild1@gmail.com>
date Tue, 11 Mar 2025 18:37:16 +0000
parent 13642:1b2de94f0580
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Tue Mar 11 18:27:54 2025 +0000
+++ b/plugins/mod_c2s.lua	Tue Mar 11 18:37:16 2025 +0000
@@ -252,12 +252,16 @@
 				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;