When creating a new context, set lastcmd to now.
authorArt Cancro <ajc@citadel.org>
Mon, 20 Sep 2010 19:52:15 +0000 (15:52 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 20 Sep 2010 19:52:15 +0000 (15:52 -0400)
This prevents the idle timer from performing acts of infanticide.
It also solves, once and for all, the "unexpected answer from
Citadel server; bailing out" error messages in webcit.

citadel/context.c

index 922f0675db24dda2dd6d56054a09cd09f990bedb..f6bbf58b635d95fdd1b6fd6b7aae348adfaebdcf 100644 (file)
@@ -383,6 +383,7 @@ CitContext *CreateNewContext(void) {
        me->cs_pid = ++next_pid;
        me->prev = NULL;
        me->next = ContextList;
+       me->lastcmd = time(NULL);       /* set lastcmd to now to prevent idle timer infanticide */
        ContextList = me;
        if (me->next != NULL) {
                me->next->prev = me;