Merge branch 'develop' into hackathon/zeroconf-dnssec

This commit is contained in:
Willem Toorop 2017-03-26 10:46:50 -05:00
commit f4fe2cb6c5
1 changed files with 10 additions and 6 deletions

View File

@ -123,18 +123,22 @@ getdns_sync_data_cleanup(getdns_sync_data *data)
* synchronous request.
*/
GETDNS_CLEAR_EVENT(upstream->loop, &upstream->event);
(*upstream->event.timeout_cb)(upstream->event.userarg);
/* This should have cleared the event */
assert(!upstream->event.read_cb &&
!upstream->event.write_cb &&
!upstream->event.timeout_cb);
if (upstream->conn_state != GETDNS_CONN_OPEN ||
upstream->keepalive_timeout == 0)
(*upstream->event.timeout_cb)(upstream->event.userarg);
}
upstream->loop = data->context->extension;
upstream->is_sync_loop = 0;
if (upstream->event.read_cb || upstream->event.write_cb)
GETDNS_SCHEDULE_EVENT(upstream->loop, upstream->fd,
TIMEOUT_FOREVER, &upstream->event);
else if (upstream->event.timeout_cb &&
upstream->conn_state == GETDNS_CONN_OPEN &&
upstream->keepalive_timeout != 0) {
GETDNS_SCHEDULE_EVENT(upstream->loop, upstream->fd,
upstream->keepalive_timeout, &upstream->event);
}
}
}