From b97568cac283b6ff847521014524bd310714ebb4 Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Tue, 23 Jul 2013 16:21:52 -0400 Subject: [PATCH] Fix status bar timeout when the client is not yet connected to the session --- tmate-msg.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tmate-msg.c b/tmate-msg.c index 2ab663f6..001c7cef 100644 --- a/tmate-msg.c +++ b/tmate-msg.c @@ -23,10 +23,15 @@ static void tmate_status_message_client(struct client *c, const char *message) msg->msg_time = time(NULL); msg->msg = xstrdup(c->message_string); - if (!s) - return; + if (s) { + limit = options_get_number(&s->options, "message-limit"); + delay = options_get_number(&s->options, "tmate-display-time"); + } else { + /* Very early in the connection process we won't have a session */ + limit = options_get_number(&global_s_options, "message-limit"); + delay = options_get_number(&global_s_options, "tmate-display-time"); + } - limit = options_get_number(&s->options, "message-limit"); if (ARRAY_LENGTH(&c->message_log) > limit) { limit = ARRAY_LENGTH(&c->message_log) - limit; for (i = 0; i < limit; i++) { @@ -36,7 +41,6 @@ static void tmate_status_message_client(struct client *c, const char *message) } } - delay = options_get_number(&c->session->options, "tmate-display-time"); tv.tv_sec = delay / 1000; tv.tv_usec = (delay % 1000) * 1000L;