Compare commits

..

No commits in common. "c2c3a144d224a97c720321f946d759d5e70f8282" and "a62843cd759bf0435eaf3b4a38cc69c9b2d9f1eb" have entirely different histories.

3 changed files with 8 additions and 65 deletions

View File

@ -1,11 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: ✨ Feature Request or Idea
url: https://github.com/markqvist/Reticulum/discussions/new?category=ideas
about: Propose and discuss features and ideas
- name: 💬 Questions, Help & Discussion
about: Ask anything, or get help
url: https://github.com/markqvist/Reticulum/discussions/new/choose
- name: 📖 Read the Reticulum Manual
url: https://markqvist.github.io/Reticulum/manual/
about: The complete documentation for Reticulum

View File

@ -1,35 +0,0 @@
---
name: "\U0001F41B Bug Report"
about: Report a reproducible bug
title: ''
labels: ''
assignees: ''
---
**Read the Contribution Guidelines**
Before creating a bug report on this issue tracker, you **must** read the [Contribution Guidelines](https://github.com/markqvist/Reticulum/blob/master/Contributing.md). Issues that do not follow the contribution guidelines **will be deleted without comment**.
- The issue tracker is used by developers of this project. **Do not use it to ask general questions, or for support requests**.
- Ideas and feature requests can be made on the [Discussions](https://github.com/markqvist/Reticulum/discussions). **Only** feature requests accepted by maintainers and developers are tracked and included on the issue tracker. **Do not post feature requests here**.
- After reading the [Contribution Guidelines](https://github.com/markqvist/Reticulum/blob/master/Contributing.md), delete this section from your bug report.
**Describe the Bug**
A clear and concise description of what the bug is.
**To Reproduce**
Describe in detail how to reproduce the bug.
**Expected Behavior**
A clear and concise description of what you expected to happen.
**Logs & Screenshots**
Please include any relevant log output. If applicable, also add screenshots to help explain your problem.
**System Information**
- OS and version
- Python version
- Program version
**Additional context**
Add any other context about the problem here.

View File

@ -124,7 +124,7 @@ class Link:
link.last_inbound = time.time()
link.start_watchdog()
RNS.log("Incoming link request "+str(link)+" accepted", RNS.LOG_DEBUG)
RNS.log("Incoming link request "+str(link)+" accepted", RNS.LOG_VERBOSE)
return link
except Exception as e:
@ -133,7 +133,7 @@ class Link:
return None
else:
RNS.log("Invalid link request payload size, dropping request", RNS.LOG_DEBUG)
RNS.log("Invalid link request payload size, dropping request", RNS.LOG_VERBOSE)
return None
@ -150,7 +150,6 @@ class Link:
self.last_inbound = 0
self.last_outbound = 0
self.last_proof = 0
self.last_data = 0
self.tx = 0
self.rx = 0
self.txbytes = 0
@ -461,7 +460,7 @@ class Link:
def no_inbound_for(self):
"""
:returns: The time in seconds since last inbound packet on the link. This includes keepalive packets.
:returns: The time in seconds since last inbound packet on the link.
"""
activated_at = self.activated_at if self.activated_at != None else 0
last_inbound = max(self.last_inbound, activated_at)
@ -469,19 +468,13 @@ class Link:
def no_outbound_for(self):
"""
:returns: The time in seconds since last outbound packet on the link. This includes keepalive packets.
:returns: The time in seconds since last outbound packet on the link.
"""
return time.time() - self.last_outbound
def no_data_for(self):
"""
:returns: The time in seconds since payload data traversed the link. This excludes keepalive packets.
"""
return time.time() - self.last_data
def inactive_for(self):
"""
:returns: The time in seconds since activity on the link. This includes keepalive packets.
:returns: The time in seconds since activity on the link.
"""
return min(self.no_inbound_for(), self.no_outbound_for())
@ -491,10 +484,8 @@ class Link:
"""
return self.__remote_identity
def had_outbound(self, is_keepalive=False):
def had_outbound(self):
self.last_outbound = time.time()
if not is_keepalive:
self.last_data = self.last_outbound
def teardown(self):
"""
@ -645,7 +636,7 @@ class Link:
def send_keepalive(self):
keepalive_packet = RNS.Packet(self, bytes([0xFF]), context=RNS.Packet.KEEPALIVE)
keepalive_packet.send()
self.had_outbound(is_keepalive = True)
self.had_outbound()
def handle_request(self, request_id, unpacked_request):
if self.status == Link.ACTIVE:
@ -751,8 +742,6 @@ class Link:
RNS.log("Link-associated packet received on unexpected interface! Someone might be trying to manipulate your communication!", RNS.LOG_ERROR)
else:
self.last_inbound = time.time()
if packet.context != RNS.Packet.KEEPALIVE:
self.last_data = self.last_inbound
self.rx += 1
self.rxbytes += len(packet.data)
if self.status == Link.STALE:
@ -911,7 +900,7 @@ class Link:
if not self.initiator and packet.data == bytes([0xFF]):
keepalive_packet = RNS.Packet(self, bytes([0xFE]), context=RNS.Packet.KEEPALIVE)
keepalive_packet.send()
self.had_outbound(is_keepalive = True)
self.had_outbound()
# TODO: find the most efficient way to allow multiple