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). */
| 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). */ |
| 98 | static 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 |
nothing calls this directly
no outgoing calls
no test coverage detected