Fixed invalid EPOLL modification error handler

This commit is contained in:
Mark Qvist
2026-04-15 12:04:26 +02:00
parent 866e63f0fe
commit 4a930ba82a
+4 -5
View File
@@ -228,10 +228,10 @@ class BackboneInterface(Interface):
if interface.socket: if interface.socket:
fileno = interface.socket.fileno() fileno = interface.socket.fileno()
if fileno in BackboneInterface.spawned_interface_filenos: if fileno in BackboneInterface.spawned_interface_filenos:
try: try: BackboneInterface.epoll.modify(fileno, select.EPOLLOUT)
BackboneInterface.epoll.modify(interface.socket.fileno(), select.EPOLLOUT)
except Exception as e: except Exception as e:
RNS.trace_exception(e) RNS.log(f"Error occurred on {interface} while modifying socket EPOLL state: {e}", RNS.LOG_WARNING)
raise e
@staticmethod @staticmethod
def __job(): def __job():
@@ -270,8 +270,7 @@ class BackboneInterface(Interface):
spawned_interface.receive(received_bytes) spawned_interface.receive(received_bytes)
elif client_socket and fileno == client_socket.fileno() and (event & select.EPOLLOUT): elif client_socket and fileno == client_socket.fileno() and (event & select.EPOLLOUT):
try: try: written = client_socket.send(spawned_interface.transmit_buffer)
written = client_socket.send(spawned_interface.transmit_buffer)
except Exception as e: except Exception as e:
written = 0 written = 0
if not spawned_interface.detached: RNS.log(f"Error while writing to {spawned_interface}: {e}", RNS.LOG_DEBUG) if not spawned_interface.detached: RNS.log(f"Error while writing to {spawned_interface}: {e}", RNS.LOG_DEBUG)