AmendHub

Download:

jcs

/

subtext

/

amendments

/

143

session: Do session close log from each node type


jcs made amendment 143 over 2 years ago
--- console.c Tue Jun 7 14:01:20 2022 +++ console.c Mon Jun 13 16:34:42 2022 @@ -330,6 +330,7 @@ void console_close_from_session(struct session *session) { struct console *console = (struct console *)session->cookie; + session_log(session, "Closing console session"); destroy_focusable(console->focusable); free(console); } --- serial.c Thu Apr 14 15:32:59 2022 +++ serial.c Mon Jun 13 16:35:14 2022 @@ -376,5 +376,6 @@ serial_output(struct session *session) void serial_close(struct session *session) { + session_log(session, "Closing serial session"); serial_reset(); } --- session.c Sun Jun 12 22:23:50 2022 +++ session.c Mon Jun 13 16:36:27 2022 @@ -289,8 +289,6 @@ session_close(struct session *session) /* finalize session log */ session->log.logged_off_at = Time; - session_log(session, "Closing session"); - if (bile_write(db->sessions_bile, SL_LOG_RTYPE, session->log.id, &session->log, sizeof(session->log)) != sizeof(session->log)) panic("bile_write of session log failed: %d", @@ -553,7 +551,10 @@ done_consuming: return ret; idled_out: - session_log(session, "Idle too long, logging out"); + if (session->logged_in) + session_log(session, "Idle too long, logging out"); + else + session_log(session, "Took too long to login, disconnecting"); session_printf(session, "\r\n\r\nYou have been idle too long, goodbye.\r\n\r\n"); session_flush(session);