chiark / gitweb /
timeout robustness: Introduce adns__timeout_{set,clear}
[adns.git] / src / internal.h
index 0fd64da3791fbe8ce89608676d756f07a1f78782..23c7aa6fddc3dd371173fc889e3c3af7260e2b94 100644 (file)
@@ -298,7 +298,7 @@ struct adns__query {
   int id, flags, retries;
   int udpnextserver;
   unsigned long udpsent; /* bitmap indexed by server */
-  struct timeval timeout;
+  struct timeval timeout_expires;
   time_t expires; /* Earliest expiry time of any record we used. */
 
   qcontext ctx;
@@ -885,6 +885,11 @@ void adns__autosys(adns_state ads, struct timeval now);
  * lest we end up in recursive descent !
  */
 
+void adns__timeout_set(adns_query qu, struct timeval now, int ms);
+static inline void adns__timeout_clear(adns_query qu)
+  { timerclear(&qu->timeout_expires); }
+
+
 void adns__must_gettimeofday(adns_state ads, const struct timeval **now_io,
                             struct timeval *tv_buf);
 /* Call with care - might reentrantly cause queries to be completed! */