From: Wilfried Goesgens Date: Mon, 7 May 2012 21:24:34 +0000 (+0200) Subject: EVENT-Client: set context on attach. X-Git-Tag: v8.11~30 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=4c6b9464ce712afd633ec317f501e5a6fd12a6a3 EVENT-Client: set context on attach. --- 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)