C-Ares: stop timer for timeouts in all cases.
[citadel.git] / citadel / modules / c-ares-dns / serv_c-ares-dns.c
index e945ccf9f785da5f30de87acbc23942e8a31cd49..278dd0c8a86c0868730d6dd43dbb5d8ad2520e80 100644 (file)
@@ -1,19 +1,19 @@
 /*
- * Copyright (c) 1998-2009 by the citadel.org team
+ * Copyright (c) 1998-2012 by the citadel.org team
  *
- *  This program is free 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.
+ *  This program is open source software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3.
+ *  
+ *  
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  
+ *  
+ *  
  *
  *  Inspired by NodeJS.org; thanks for the MX-Parser ;-)
  */
@@ -297,6 +297,7 @@ void QueryCbDone(AsyncIO *IO)
 
 void DestructCAres(AsyncIO *IO)
 {
+       ev_timer_stop (event_base, &IO->DNS.timeout);
        ares_destroy_options(&IO->DNS.Options);
 }
 
@@ -363,6 +364,7 @@ void QueueGetHostByNameDone(void *Ctx,
        EV_DNS_LOGT_INIT(unwind_stack);
        EV_DNS_LOGT_START(unwind_stack);
        ev_idle_start(event_base, &IO->unwind_stack);
+       ev_timer_stop (event_base, &IO->DNS.timeout);
 }
 
 void QueueGetHostByName(AsyncIO *IO,