From: Guus Sliepen Date: Sat, 4 Jul 2020 10:26:00 +0000 (+0200) Subject: Ensure the maxtimeout value is taken from the destination node's device class. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=40507802ddac36012a59beec96cb02060f8d0293;p=meshlink Ensure the maxtimeout value is taken from the destination node's device class. --- diff --git a/src/net_socket.c b/src/net_socket.c index 6af4f738..a6923139 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -93,8 +93,10 @@ void retry_outgoing(meshlink_handle_t *mesh, outgoing_t *outgoing) { outgoing->timeout += 5; } - if(outgoing->timeout > mesh->dev_class_traits[mesh->devclass].maxtimeout) { - outgoing->timeout = mesh->dev_class_traits[mesh->devclass].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) {