Software /
code /
prosody
Comparison
plugins/mod_c2s.lua @ 11514:11186af62c87
Merge 0.11->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 10 Apr 2021 16:45:44 +0200 |
parent | 11477:c90ef8745779 |
parent | 11511:cab64a0aad49 |
child | 11517:f7275c2c58fa |
comparison
equal
deleted
inserted
replaced
11506:9a3ebdd65f9c | 11514:11186af62c87 |
---|---|
208 -- Grace time to process data from authenticated cleanly-closed stream | 208 -- Grace time to process data from authenticated cleanly-closed stream |
209 add_task(stream_close_timeout, function () | 209 add_task(stream_close_timeout, function () |
210 if not session.destroyed then | 210 if not session.destroyed then |
211 session.log("warn", "Failed to receive a stream close response, closing connection anyway..."); | 211 session.log("warn", "Failed to receive a stream close response, closing connection anyway..."); |
212 sm_destroy_session(session, reason_text); | 212 sm_destroy_session(session, reason_text); |
213 conn:close(); | 213 if conn then conn:close(); end |
214 end | 214 end |
215 end); | 215 end); |
216 else | 216 else |
217 sm_destroy_session(session, reason_text); | 217 sm_destroy_session(session, reason_text); |
218 conn:close(); | 218 if conn then conn:close(); end |
219 end | 219 end |
220 else | 220 else |
221 local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason; | 221 local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason; |
222 sm_destroy_session(session, reason_text); | 222 sm_destroy_session(session, reason_text); |
223 end | 223 end |
244 end | 244 end |
245 end | 245 end |
246 end, 200); | 246 end, 200); |
247 | 247 |
248 function runner_callbacks:ready() | 248 function runner_callbacks:ready() |
249 self.data.conn:resume(); | 249 if self.data.conn then |
250 self.data.conn:resume(); | |
251 else | |
252 (self.data.log or log)("debug", "Session has no connection to resume"); | |
253 end | |
250 end | 254 end |
251 | 255 |
252 function runner_callbacks:waiting() | 256 function runner_callbacks:waiting() |
253 self.data.conn:pause(); | 257 if self.data.conn then |
258 self.data.conn:pause(); | |
259 else | |
260 (self.data.log or log)("debug", "Session has no connection to pause while waiting"); | |
261 end | |
254 end | 262 end |
255 | 263 |
256 function runner_callbacks:error(err) | 264 function runner_callbacks:error(err) |
257 (self.data.log or log)("error", "Traceback[c2s]: %s", err); | 265 (self.data.log or log)("error", "Traceback[c2s]: %s", err); |
258 end | 266 end |