comparison mod_bidi/mod_bidi.lua @ 897:844b6ef5d4c4

mod_bidi: Disassociate bidi and original session when they are destroyed
author Kim Alvefur <zash@zash.se>
date Wed, 16 Jan 2013 08:33:20 +0100
parents d066987e00b7
children 4aa473216432
comparison
equal deleted inserted replaced
896:d24d87ca3f5f 897:844b6ef5d4c4
110 110
111 function disable_bidi(event) 111 function disable_bidi(event)
112 local session = event.session; 112 local session = event.session;
113 if session.bidi_session then 113 if session.bidi_session then
114 local bidi_session = session.bidi_session; 114 local bidi_session = session.bidi_session;
115 session.bidi_session = nil; 115 session.bidi_session, bidi_session.orig_session = nil, nil;
116 session.log("debug", "Tearing down bidirectional stream"); 116 session.log("debug", "Tearing down bidirectional stream");
117 s2smanager.destroy_session(bidi_session, event.reason); 117 s2smanager.destroy_session(bidi_session, event.reason);
118 elseif session.orig_session then 118 elseif session.orig_session then
119 local orig_session = session.orig_session; 119 local orig_session = session.orig_session;
120 session.orig_session = nil; 120 orig_session.bidi_session, session.orig_session = nil, nil;
121 orig_session.log("debug", "Tearing down bidirectional stream"); 121 orig_session.log("debug", "Tearing down bidirectional stream");
122 s2smanager.destroy_session(orig_session, event.reason); 122 s2smanager.destroy_session(orig_session, event.reason);
123 end 123 end
124 end 124 end
125 125