MCPcopy Create free account
hub / github.com/ElementsProject/lightning / dns_call_cb

Function dns_call_cb

connectd/dns.c:98–109  ·  view source on GitHub ↗

Defer the callback onto the io loop: we never call it synchronously, and * it must be the last thing we do (it may free lookup, and thus us). */

Source from the content-addressed store, hash-verified

96/* Defer the callback onto the io loop: we never call it synchronously, and
97 * it must be the last thing we do (it may free lookup, and thus us). */
98static void dns_call_cb(struct dns_lookup *lookup)
99{
100 lookup->call_timer = NULL;
101 status_debug("dns: lookup of %s %s",
102 lookup->hostname,
103 lookup->err ? lookup->err : "succeeded");
104 /* Callback may free lookup: the lookups above are all we do first. */
105 if (lookup->err)
106 lookup->cb(lookup->cb_arg, NULL, lookup->err);
107 else
108 lookup->cb(lookup->cb_arg, lookup->addrs, NULL);
109}
110
111/* Stop everything and schedule the callback. Safe from timer or normal
112 * loop context; from inside an io callback on lookup->conn, detach the conn

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected