On 01/16/2012 10:32 AM, Henrik Nordström wrote:
> This implements sending DNS A & AAAA queries in parallel by
> creating "slave" idns_query requests. Current implementation
> uses the A lookup as "master" and AAAA as "slave" query.
As implemented, the half-baked slave query cannot exist without the
master because it does not have callback information (at least).
However, the error and timeout handling code still thinks that each
query is fully capable of standing on its own:
> if (q->rcode != 0)
> idnsCallback(q, NULL, -q->rcode, rfc1035ErrorMessage(q->rcode)!
> else
> idnsCallback(q, NULL, -16, "Timeout");
>
> cbdataFree(q);
Squid dumps core in idnsCallback() when the slave query times out
because q->callback is nil and the callback_data validity check is useless.
There may be other similar leftovers from the good old days where we did
not have half-baked queries; I have not checked.
One solution would be to change the slave query class type so that it
does not have the currently unset fields (such as callback). This would
expose bugs like the one above at compile time.
An even better approach would be to store information common to A and
AAAA queries separately from the queries themselves, remove master/slave
roles, and treat all queries similarly again (except where the A vs AAAA
difference is important). However, this will require more changes.
Please fix.
Thank you,
Alex.
Received on Tue Feb 28 2012 - 01:26:59 MST
This archive was generated by hypermail 2.2.0 : Tue Feb 28 2012 - 12:00:21 MST