comparison common-session.c @ 733:70811267715c

Run the cleanup handler also when we close due to TCP connection being closed
author Matt Johnston <matt@ucc.asn.au>
date Mon, 01 Apr 2013 22:26:55 +0800
parents 78eda530c000
children 685d05f1cc5c
comparison
equal deleted inserted replaced
732:2e5f2bc60e40 733:70811267715c
232 232
233 /* Not reached */ 233 /* Not reached */
234 } 234 }
235 235
236 /* clean up a session on exit */ 236 /* clean up a session on exit */
237 void common_session_cleanup() { 237 void session_cleanup() {
238 238
239 TRACE(("enter session_cleanup")) 239 TRACE(("enter session_cleanup"))
240 240
241 /* we can't cleanup if we don't know the session state */ 241 /* we can't cleanup if we don't know the session state */
242 if (!sessinitdone) { 242 if (!sessinitdone) {
243 TRACE(("leave session_cleanup: !sessinitdone")) 243 TRACE(("leave session_cleanup: !sessinitdone"))
244 return; 244 return;
245 }
246
247 if (ses.extra_session_cleanup) {
248 ses.extra_session_cleanup();
245 } 249 }
246 250
247 m_free(ses.session_id); 251 m_free(ses.session_id);
248 m_burn(ses.keys, sizeof(struct key_context)); 252 m_burn(ses.keys, sizeof(struct key_context));
249 m_free(ses.keys); 253 m_free(ses.keys);