From 4c6b9464ce712afd633ec317f501e5a6fd12a6a3 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 7 May 2012 23:24:34 +0200 Subject: [PATCH] EVENT-Client: set context on attach. --- citadel/modules/eventclient/serv_eventclient.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/citadel/modules/eventclient/serv_eventclient.c b/citadel/modules/eventclient/serv_eventclient.c index f991cf905..ec8b35cca 100644 --- a/citadel/modules/eventclient/serv_eventclient.c +++ b/citadel/modules/eventclient/serv_eventclient.c @@ -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) -- 2.30.2