25 January 2008: Wouter
- added tpkg for asynclook and library use.
- allows localhost to be queried when as a library.
+ - fixup race condition between cancel and answer (in case of
+ really fast answers that beat the cancel).
24 January 2008: Wouter
- tested the cancel() function.
q = context_deserialize_answer(ctx, msg, len, &err);
if(!q) {
lock_basic_unlock(&ctx->cfglock);
- return 0;
+ /* probably simply the lookup that failed, i.e.
+ * response returned before cancel was sent out, so noerror */
+ return 1;
}
log_assert(q->async);
{
struct ctx_query* q = context_deserialize_cancel(w->ctx, buf, len);
if(!q) {
- log_err("deserialize cancel failed");
+ /* probably simply lookup failed, i.e. the message had been
+ * processed and answered before the cancel arrived */
return;
}
q->cancelled = 1;