- memcpy(&c->address, c->outgoing->aip->ai_addr, c->outgoing->aip->ai_addrlen);
- c->outgoing->aip = c->outgoing->aip->ai_next;
+ return false;
+}
+
+void do_outgoing_connection(meshlink_handle_t *mesh, outgoing_t *outgoing) {
+begin:
+
+ if(!get_next_outgoing_address(mesh, outgoing)) {
+ if(outgoing->state == OUTGOING_CANONICAL_RESOLVE) {
+ /* We are waiting for a callback from the ADNS thread */
+ } else if(outgoing->state == OUTGOING_NO_KNOWN_ADDRESSES) {
+ logger(mesh, MESHLINK_ERROR, "No known addresses for %s", outgoing->node->name);
+ } else {
+ logger(mesh, MESHLINK_ERROR, "Could not set up a meta connection to %s", outgoing->node->name);
+ retry_outgoing(mesh, outgoing);
+ }
+
+ return;
+ }