From: Wilfried Goesgens Date: Mon, 23 Jul 2012 13:44:27 +0000 (+0200) Subject: EVENT-Q: the IO eventqueue also needs to check the reply of the attach function for... X-Git-Tag: v8.20~296 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=6afc78f17f5c2d19feb2671afa942653ef905b5a EVENT-Q: the IO eventqueue also needs to check the reply of the attach function for terminate situations. --- diff --git a/citadel/modules/eventclient/serv_eventclient.c b/citadel/modules/eventclient/serv_eventclient.c index d54d72947..01492e56c 100644 --- a/citadel/modules/eventclient/serv_eventclient.c +++ b/citadel/modules/eventclient/serv_eventclient.c @@ -593,6 +593,7 @@ pthread_mutex_t EventExitQueueMutex; /* locks the access to the event queue poin HashList *QueueEvents = NULL; HashList *InboundEventQueue = NULL; HashList *InboundEventQueues[2] = { NULL, NULL }; +extern void ShutDownCLient(AsyncIO *IO); ev_async AddJob; ev_async ExitEventLoop; @@ -634,7 +635,25 @@ static void QueueEventAddCallback(EV_P_ ev_async *w, int revents) become_session(Ctx); h->IO->Now = Now; - h->EvAttch(h->IO); + switch (h->EvAttch(h->IO)) + { + case eReadMore: + case eReadMessage: + case eReadFile: + case eSendReply: + case eSendMore: + case eReadPayload: + case eSendFile: + case eDBQuery: + case eSendDNSQuery: + case eReadDNSReply: + case eConnect: + break; + case eTerminateConnection: + case eAbort: + ShutDownCLient(h->IO); + break; + } } DeleteHashPos(&It); DeleteHashContent(&q);