timeout issue with UDNS

Abhijit Pandey abhijpandey at gmail.com
Thu Oct 22 22:04:40 MSD 2009


Hi Michael,

There seems to be  a bug in submitting queries.
The queries are added to the list of active queries at the head.

The last Query added to list is on top.

When timeout is called.
We are only looking at the head of the active query, and ignoring the rest.
Since the queries at tail end were added first, the timeouts on the
tail end queries will happen only when the head end queries time out.

When we resend the query. It is attached correctly to the list.

   /* insert from the tail */
    struct dns_query *p;
    QLIST_FOR_EACH(&ctx->dnsc_qactive, p, prev)
      if (p->dnsq_deadline <= q->dnsq_deadline)
    break;
    qlist_insert_after(q, p);




Shouldn't we do the same while submitting the queries too.

>>>qlist_add_head(q, &ctx->dnsc_qactive);

replaced by
   /* insert from the tail */
    struct dns_query *p;
    QLIST_FOR_EACH(&ctx->dnsc_qactive, p, prev)
      if (p->dnsq_deadline <= q->dnsq_deadline)
    break;
    qlist_insert_after(q, p);



Let me know what you think.

Thanks,
Abhijit


More information about the udns mailing list