EVENT-Client: set context on attach.
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 7 May 2012 21:24:34 +0000 (23:24 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 7 May 2012 21:24:34 +0000 (23:24 +0200)
citadel/modules/eventclient/serv_eventclient.c

index f991cf90587480a53b73735a9ab5fe9387c6ce0c..ec8b35cca41d867793ca3f36103d79e1bc212ead 100644 (file)
@@ -599,6 +599,7 @@ ev_async ExitEventLoop;
 
 static void QueueEventAddCallback(EV_P_ ev_async *w, int revents)
 {
+       CitContext *Ctx;
        ev_tstamp Now;
        HashList *q;
        void *v;
@@ -629,6 +630,9 @@ static void QueueEventAddCallback(EV_P_ ev_async *w, int revents)
                if (h->IO->StartIO == 0.0)
                        h->IO->StartIO = Now;
 
+               Ctx = h->IO->CitContext;
+               become_session(Ctx);
+
                h->IO->Now = Now;
                h->EvAttch(h->IO);
        }
@@ -723,6 +727,7 @@ extern void ShutDownDBCLient(AsyncIO *IO);
 
 static void DBQueueEventAddCallback(EV_P_ ev_async *w, int revents)
 {
+       CitContext *Ctx;
        ev_tstamp Now;
        HashList *q;
        void *v;
@@ -754,6 +759,9 @@ static void DBQueueEventAddCallback(EV_P_ ev_async *w, int revents)
                if (h->IO->StartDB == 0.0)
                        h->IO->StartDB = Now;
                h->IO->Now = Now;
+
+               Ctx = h->IO->CitContext;
+               become_session(Ctx);
                ev_cleanup_start(event_db, &h->IO->db_abort_by_shutdown);
                rc = h->EvAttch(h->IO);
                switch (rc)