Guest User

transport patch

a guest
Aug 14th, 2026
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.79 KB | None | 0 0
  1. diff --git a/RNS/Transport.py b/RNS/Transport.py
  2. index 1453f78d..0af962da 100755
  3. --- a/RNS/Transport.py
  4. +++ b/RNS/Transport.py
  5. @@ -3119,9 +3119,20 @@ class Transport:
  6.                      return
  7.  
  8.                  # Forward path request on all interfaces
  9. -                # except the requestor interface
  10. +                # except the requestor interface.
  11. +                # The discovery timeout must also cover a full round trip for an MTU on the slowest interface
  12. +                discovery_timeout = Transport.PATH_REQUEST_TIMEOUT
  13. +                for interface in Transport.interfaces:
  14. +                    if search_mode_filter and not interface.mode in search_mode_filter: continue
  15. +                    if not interface.online or interface == attached_interface: continue
  16. +                    if interface.bitrate != None and interface.bitrate > 0:
  17. +                        medium_timeout = 2*(RNS.Reticulum.MTU*8/max(interface.bitrate, RNS.Reticulum.MINIMUM_BITRATE)) + Transport.PATH_REQUEST_GRACE
  18. +                        if medium_timeout > discovery_timeout: discovery_timeout = medium_timeout
  19. +
  20.                  RNS.log("Attempting to discover unknown path to "+RNS.prettyhexrep(destination_hash)+" on behalf of path request"+interface_str, RNS.LOG_PATHING) if RNS.sl(RNS.LOG_PATHING) else None
  21. -                pr_entry = { "destination_hash": destination_hash, "timeout": time.time()+Transport.PATH_REQUEST_TIMEOUT, "requesting_interface": attached_interface }
  22. +                pr_entry = { "destination_hash": destination_hash, "timeout": time.time()+discovery_timeout, "requesting_interface": attached_interface }
  23.                  with Transport.discovery_pr_lock: Transport.discovery_path_requests[destination_hash] = pr_entry
  24.  
  25.                  for interface in Transport.interfaces:
  26.  
Advertisement
Add Comment
Please, Sign In to add comment