Software /
code /
prosody
Comparison
plugins/mod_c2s.lua @ 11509:dfdec3f9ccb1 0.11
mod_c2s: Fix traceback in session close when conn is nil
Unclear how this happens.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 17 Mar 2021 12:47:16 +0100 |
parent | 11507:133e8ed291fe |
child | 11510:d241ca8272fe |
comparison
equal
deleted
inserted
replaced
11508:f1abc34414bc | 11509:dfdec3f9ccb1 |
---|---|
188 -- Grace time to process data from authenticated cleanly-closed stream | 188 -- Grace time to process data from authenticated cleanly-closed stream |
189 add_task(stream_close_timeout, function () | 189 add_task(stream_close_timeout, function () |
190 if not session.destroyed then | 190 if not session.destroyed then |
191 session.log("warn", "Failed to receive a stream close response, closing connection anyway..."); | 191 session.log("warn", "Failed to receive a stream close response, closing connection anyway..."); |
192 sm_destroy_session(session, reason_text); | 192 sm_destroy_session(session, reason_text); |
193 conn:close(); | 193 if conn then conn:close(); end |
194 end | 194 end |
195 end); | 195 end); |
196 else | 196 else |
197 sm_destroy_session(session, reason_text); | 197 sm_destroy_session(session, reason_text); |
198 conn:close(); | 198 if conn then conn:close(); end |
199 end | 199 end |
200 else | 200 else |
201 local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason; | 201 local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason; |
202 sm_destroy_session(session, reason_text); | 202 sm_destroy_session(session, reason_text); |
203 end | 203 end |