struct UnresolvedSource *next;
};
+#define RESOLVE_INTERVAL_UNIT 7
+#define MIN_RESOLVE_INTERVAL 2
+#define MAX_RESOLVE_INTERVAL 9
+
static struct UnresolvedSource *unresolved_sources = NULL;
static int resolving_interval = 0;
static SCH_TimeoutID resolving_id;
/* This was the last source in the list. If some sources couldn't
be resolved, try again in exponentially increasing interval. */
if (unresolved_sources) {
- if (resolving_interval < 9)
+ if (resolving_interval < MIN_RESOLVE_INTERVAL)
+ resolving_interval = MIN_RESOLVE_INTERVAL;
+ else if (resolving_interval < MAX_RESOLVE_INTERVAL)
resolving_interval++;
- resolving_id = SCH_AddTimeoutByDelay(7 * (1 << resolving_interval), resolve_sources, NULL);
+ resolving_id = SCH_AddTimeoutByDelay(RESOLVE_INTERVAL_UNIT *
+ (1 << resolving_interval), resolve_sources, NULL);
} else {
resolving_interval = 0;
}
for (i = &unresolved_sources; *i; i = &(*i)->next)
;
*i = us;
-
- if (!resolving_interval) {
- resolving_interval = 2;
- resolving_id = SCH_AddTimeoutByDelay(7 * (1 << resolving_interval), resolve_sources, NULL);
- }
}
/* ================================================== */
/* Set the handler, or NULL to disable the notification */
extern void NSR_SetSourceResolvingEndHandler(NSR_SourceResolvingEndHandler handler);
-/* Procedure to start resolving unresolved sources immediately */
+/* Procedure to start resolving unresolved sources */
extern void NSR_ResolveSources(void);
/* Procedure to start all sources */