]> code.citadel.org Git - citadel.git/blobdiff - citadel/event_client.c
Fix memleaks
[citadel.git] / citadel / event_client.c
index 94777828a5974c6f9e7229a97c765b7a8531beb3..d87d6697f8bfc0ea79489cea15be4617bb87cd02 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1998-2009 by the citadel.org team
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 3 of the License, or
  *  (at your option) any later version.
@@ -227,18 +227,6 @@ eNextState QueueCurlContext(AsyncIO *IO)
        return eSendReply;
 }
 
-int ShutDownEventQueue(void)
-{
-       pthread_mutex_lock(&DBEventQueueMutex);
-       ev_async_send (event_db, &DBExitEventLoop);
-       pthread_mutex_unlock(&DBEventQueueMutex);
-
-       pthread_mutex_lock(&EventQueueMutex);
-       ev_async_send (EV_DEFAULT_ &ExitEventLoop);
-       pthread_mutex_unlock(&EventQueueMutex);
-       return 0;
-}
-
 void FreeAsyncIOContents(AsyncIO *IO)
 {
        FreeStrBuf(&IO->IOBuf);
@@ -700,9 +688,15 @@ IO_postdns_callback(struct ev_loop *loop, ev_idle *watcher, int revents)
        switch (IO->DNSQuery->PostDNS(IO))
        {
        case eAbort:
-               IO->DNSFail(IO);
+               switch (IO->DNSFail(IO)) {
+               case eAbort:
+                       ShutDownCLient(IO);
+               default:
+                       break;
+                       
+               }
        default:
-           break;
+               break;
        }
 }