Commit 8a599f9a authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_create): Initialize resolve_callback and remote.

(isc_destroy): Cancel any pending dns query, and clear remote.
parent a3040f1b
......@@ -187,6 +187,8 @@ isc_create(struct isc_mcb *mcb,
scb->data_available_callback = NULL;
scb->stale_output_cb = NULL;
scb->acceptable_idle_time = cfg->idle_timeout;
scb->resolve_callback = NULL;
scb->pub.remote = EMPTY_STRING;
scb->cfg = cfg;
scb->pub.master = mcb;
......@@ -375,13 +377,26 @@ isc_destroy(struct isc_mcb *mcb,
struct isc_scb *scb)
{
struct isc_scb_internal *sci = (struct isc_scb_internal*)scb;
isc_resolve_done_cb *cb;
int code = 0;
int size;
if (sci->resolve_callback != NULL)
{
/* FIXME (bug 627): Cancel adns query here. */
mcb->event_source->cancel_time(mcb->event_source, OOP_TIME_NOW,
isc_dns_resolve_cb, scb);
cb = sci->resolve_callback;
sci->resolve_callback = NULL;
cb(scb, isc_resolve_aborted, 0);
}
isc_cancel_read_callback(sci);
isc_cancel_stale_output_callback(sci);
isc_cancel_idle_callback(sci);
isc_cancel_write_callback(sci);
s_clear(&scb->remote);
if (mcb)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment