summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Viennot <nicolas@viennot.biz>2013-07-23 16:21:52 -0400
committerNicolas Viennot <nicolas@viennot.biz>2013-07-23 16:22:51 -0400
commitb97568cac283b6ff847521014524bd310714ebb4 (patch)
treee62ff5c94c7040d5c424887e2254d683b86750b2
parentebc4e5ecdf177119d9d2602b6521ff8969c74998 (diff)
Fix status bar timeout when the client is not yet connected to the session
-rw-r--r--tmate-msg.c12
1 files 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;