int lowdelay = IPTOS_LOWDELAY;
setsockopt(c->socket, IPPROTO_IP, IP_TOS, (void *)&lowdelay, sizeof(lowdelay));
#endif
+
+#if defined(SO_NOSIGPIPE)
+ int nosigpipe = 1;
+ setsockopt(c->socket, SOL_SOCKET, SO_NOSIGPIPE, (void *)&nosigpipe, sizeof(nosigpipe));
+#endif
}
static void retry_outgoing_handler(event_loop_t *loop, void *data) {
outgoing->timeout += 5;
}
- if(outgoing->timeout > mesh->maxtimeout) {
- outgoing->timeout = mesh->maxtimeout;
+ int maxtimeout = mesh->dev_class_traits[outgoing->node->devclass].maxtimeout;
+
+ if(outgoing->timeout > maxtimeout) {
+ outgoing->timeout = maxtimeout;
}
timeout_add(&mesh->loop, &outgoing->ev, retry_outgoing_handler, outgoing, &(struct timespec) {
if(port) {
*port++ = 0;
port = xstrdup(port);
+ adns_queue(mesh, address, port, canonical_resolve_cb, outgoing->node, 2);
+ return false;
} else {
- port = xstrdup(mesh->myport);
+ logger(mesh, MESHLINK_ERROR, "Canonical address for %s is missing port number", n->name);
+ free(address);
+ outgoing->state = OUTGOING_RECENT;
}
- adns_queue(mesh, address, port, canonical_resolve_cb, outgoing->node, 2);
- return false;
} else {
outgoing->state = OUTGOING_RECENT;
}