]> git.meshlink.io Git - meshlink/commitdiff
Ensure the maxtimeout value is taken from the destination node's device class.
authorGuus Sliepen <guus@meshlink.io>
Sat, 4 Jul 2020 10:26:00 +0000 (12:26 +0200)
committerGuus Sliepen <guus@meshlink.io>
Sat, 4 Jul 2020 10:26:00 +0000 (12:26 +0200)
src/net_socket.c

index 6af4f7386bcc37530057fc5251de2ff0103a1137..a692313958850a0f1b87db3bb313930684cb59b9 100644 (file)
@@ -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) {