]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Tweaks
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 4 Apr 2022 14:53:37 +0000 (16:53 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 12 Apr 2022 11:39:42 +0000 (13:39 +0200)
pdns/recursordist/taskqueue.hh

index 5c55f4ae0e94331ca8b0aea1d7fb6d95fd46345b..99f82ca7c88c22ee56105fb2f5da925c40b6e06d 100644 (file)
@@ -50,10 +50,14 @@ struct ResolveTask
 {
   DNSName d_qname;
   uint16_t d_qtype;
+  // Deadline is not part of index and <
   time_t d_deadline;
-  bool d_refreshMode; // Whether to run this task in regular mode (false) or in the mode that refreshes almost expired tasks
+  // Whether to run this task in regular mode (false) or in the mode that refreshes almost expired tasks
+  bool d_refreshMode;
   // Use a function pointer as comparing std::functions is a nuisance
-  void (*d_func)(const struct timeval& now, bool logErrors, const ResolveTask& task);
+  using TaskFunction  = void (*)(const struct timeval& now, bool logErrors, const ResolveTask& task);
+  TaskFunction d_func;
+  // IP used by DoT probe tasks
   ComboAddress d_ip;
 
   bool operator<(const ResolveTask& a) const
@@ -117,7 +121,7 @@ private:
                                   member<ResolveTask, DNSName, &ResolveTask::d_qname>,
                                   member<ResolveTask, uint16_t, &ResolveTask::d_qtype>,
                                   member<ResolveTask, bool, &ResolveTask::d_refreshMode>,
-                                  member<ResolveTask, void (*)(const struct timeval& now, bool logErrors, const ResolveTask& task), &ResolveTask::d_func>,
+                                  member<ResolveTask, ResolveTask::TaskFunction, &ResolveTask::d_func>,
                                   member<ResolveTask, ComboAddress, &ResolveTask::d_ip>>>,
       sequenced<tag<SequencedTag>>>>
     queue_t;