X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fcontext_loop.c;h=47c5610f33d712c9f22c0be48b419b98c1069e27;hb=472512fe97f1bbb08f4318329b4706cfabf21e38;hp=6fab115fad22bd156cf7779246561840d184de2b;hpb=baa76dc30501a088c025fa10408ac50b4f452cba;p=citadel.git diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 6fab115fa..47c5610f3 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -64,6 +64,7 @@ void do_housekeeping(void) * Lock the session list, moving any candidates for euthanasia into * a separate list. */ + the_time = 0; CtdlLogResult(pthread_mutex_lock(&SessionListMutex)); for (sptr = SessionList; sptr != NULL; sptr = sptr->next) { if (the_time == 0) @@ -212,6 +213,7 @@ wcsession *CreateSession(int Lockable, int Static, wcsession **wclist, ParsedHtt memset(TheSession, 0, sizeof(wcsession)); TheSession->Hdr = Hdr; TheSession->serv_sock = (-1); + TheSession->lastreq = time(NULL);; pthread_setspecific(MyConKey, (void *)TheSession); @@ -492,6 +494,7 @@ void context_loop(ParsedHttpHdrs *Hdr) struct timeval tx_start; struct timeval tx_finish; int session_may_be_reused = 1; + time_t now; gettimeofday(&tx_start, NULL); /* start a stopwatch for performance timing */ @@ -589,11 +592,12 @@ void context_loop(ParsedHttpHdrs *Hdr) /* * Bind to the session and perform the transaction */ + now = time(NULL);; CtdlLogResult(pthread_mutex_lock(&TheSession->SessionMutex)); pthread_setspecific(MyConKey, (void *)TheSession); - TheSession->inuse = 1; /* mark the session as bound */ - TheSession->lastreq = time(NULL); /* log */ + TheSession->inuse = 1; /* mark the session as bound */ + TheSession->lastreq = now; /* log */ TheSession->Hdr = Hdr; /*