mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-16 17:18:51 -05:00
Fixup secondary buffer in case of error callback.
git-svn-id: file:///svn/unbound/trunk@410 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
c4e81d06b7
commit
25092accc1
2 changed files with 5 additions and 2 deletions
|
|
@ -376,6 +376,7 @@ worker_handle_service_reply(struct comm_point* c, void* arg, int error,
|
|||
struct work_query* w = e->qstate->work_info;
|
||||
struct worker* worker = e->qstate->env->worker;
|
||||
|
||||
verbose(VERB_ALGO, "worker scvd callback for qstate %p", e->qstate);
|
||||
e->qstate->reply = reply_info;
|
||||
if(error != 0) {
|
||||
worker_process_query(worker, w, e->qstate,
|
||||
|
|
|
|||
|
|
@ -1014,7 +1014,8 @@ serviced_callbacks(struct serviced_query* sq, int error, struct comm_point* c,
|
|||
rem = rbtree_delete(sq->outnet->serviced, sq);
|
||||
log_assert(rem); /* should have been present */
|
||||
sq->to_be_deleted = 1;
|
||||
if(dobackup) {
|
||||
verbose(VERB_ALGO, "svcd callbacks start");
|
||||
if(dobackup && c) {
|
||||
/* make a backup of the query, since the querystate processing
|
||||
* may send outgoing queries that overwrite the buffer.
|
||||
* use secondary buffer to store the query.
|
||||
|
|
@ -1029,7 +1030,7 @@ serviced_callbacks(struct serviced_query* sq, int error, struct comm_point* c,
|
|||
}
|
||||
while(p) {
|
||||
n = p->next;
|
||||
if(dobackup) {
|
||||
if(dobackup && c) {
|
||||
ldns_buffer_clear(c->buffer);
|
||||
ldns_buffer_write(c->buffer,
|
||||
ldns_buffer_begin(sq->outnet->udp_second),
|
||||
|
|
@ -1039,6 +1040,7 @@ serviced_callbacks(struct serviced_query* sq, int error, struct comm_point* c,
|
|||
(void)(*p->cb)(c, p->cb_arg, error, rep);
|
||||
p = n;
|
||||
}
|
||||
verbose(VERB_ALGO, "svcd callbacks end");
|
||||
log_assert(sq->cblist == NULL);
|
||||
serviced_delete(sq);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue