mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
Fixup race.
git-svn-id: file:///svn/unbound/trunk@897 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
7bfaf07981
commit
3bb9aaafca
3 changed files with 7 additions and 2 deletions
|
|
@ -1,6 +1,8 @@
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -377,7 +377,9 @@ process_answer(struct ub_val_ctx* ctx, uint8_t* msg, uint32_t len)
|
|||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,8 @@ handle_cancel(struct libworker* w, uint8_t* buf, uint32_t len)
|
|||
{
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue