From bbad75fb6c7344528c7f631c2daf09a87bab9744 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Wed, 4 Nov 2009 22:42:31 +0000 Subject: Sync OpenBSD patchset 483: Change session and client activity and creation time members to have more meaningful names. Also, remove the code to try and update the session activity time for the command client when a command message is received as is pointless because it des not have a session. --- server.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'server.c') diff --git a/server.c b/server.c index bea6f5d7..8df12e56 100644 --- a/server.c +++ b/server.c @@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.215 2009-11-02 21:39:34 tcunha Exp $ */ +/* $Id: server.c,v 1.216 2009-11-04 22:42:31 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -568,12 +568,13 @@ server_lock_server(void) continue; if (s->flags & SESSION_UNATTACHED) { - s->activity = time(NULL); + if (gettimeofday(&s->activity_time, NULL) != 0) + fatal("gettimeofday failed"); continue; } timeout = options_get_number(&s->options, "lock-after-time"); - if (timeout <= 0 || t <= s->activity + timeout) + if (timeout <= 0 || t <= s->activity_time.tv_sec + timeout) return; /* not timed out */ } @@ -596,12 +597,13 @@ server_lock_sessions(void) continue; if (s->flags & SESSION_UNATTACHED) { - s->activity = time(NULL); + if (gettimeofday(&s->activity_time, NULL) != 0) + fatal("gettimeofday failed"); continue; } timeout = options_get_number(&s->options, "lock-after-time"); - if (timeout > 0 && t > s->activity + timeout) { + if (timeout > 0 && t > s->activity_time.tv_sec + timeout) { server_lock_session(s); recalculate_sizes(); } -- cgit