diff --git a/RNS/Interfaces/BackboneInterface.py b/RNS/Interfaces/BackboneInterface.py index 9acae87..3181b56 100644 --- a/RNS/Interfaces/BackboneInterface.py +++ b/RNS/Interfaces/BackboneInterface.py @@ -231,6 +231,7 @@ class BackboneInterface(Interface): if len(received_bytes): spawned_interface.receive(received_bytes) else: BackboneInterface.deregister_fileno(fileno); client_socket.close() + if fileno in BackboneInterface.spawned_interface_filenos: BackboneInterface.spawned_interface_filenos.pop(fileno) spawned_interface.receive(received_bytes) elif client_socket and fileno == client_socket.fileno() and (event & select.EPOLLOUT): @@ -240,6 +241,7 @@ class BackboneInterface(Interface): written = 0 if not spawned_interface.detached: RNS.log(f"Error while writing to {spawned_interface}: {e}", RNS.LOG_DEBUG) BackboneInterface.deregister_fileno(fileno) + if fileno in BackboneInterface.spawned_interface_filenos: BackboneInterface.spawned_interface_filenos.pop(fileno) try: client_socket.close() except Exception as e: RNS.log(f"Error while closing socket for {spawned_interface}: {e}", RNS.LOG_ERROR) spawned_interface.receive(b"") @@ -251,6 +253,7 @@ class BackboneInterface(Interface): elif client_socket and fileno == client_socket.fileno() and event & (select.EPOLLHUP): BackboneInterface.deregister_fileno(fileno) + if fileno in BackboneInterface.spawned_interface_filenos: BackboneInterface.spawned_interface_filenos.pop(fileno) try: client_socket.close() except Exception as e: RNS.log(f"Error while closing socket for {spawned_interface}: {e}", RNS.LOG_ERROR) spawned_interface.receive(b"")