diff options
author | adrien <adrien@luxeylab.net> | 2021-12-28 11:56:12 +0100 |
---|---|---|
committer | adrien <adrien@luxeylab.net> | 2021-12-28 11:56:12 +0100 |
commit | 4560622fa125afb8ac5161f8d0e8a353f99f7a38 (patch) | |
tree | 0e6b8c716955ea5bb5896c5dc4c8294b69e54137 /src/fw_actor.rs | |
parent | 4d4d453afa3edafe71db2ae60171b8696b38a3c9 (diff) | |
parent | 7760b9c58fd98dd934a8f553dd7462049f545cf4 (diff) | |
download | diplonat-4560622fa125afb8ac5161f8d0e8a353f99f7a38.tar.gz diplonat-4560622fa125afb8ac5161f8d0e8a353f99f7a38.zip |
Merge pull request 'Allow Diplonat to automatically detect it's private IP' (#12) from autodetect-private-ip into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/diplonat/pulls/12
Diffstat (limited to 'src/fw_actor.rs')
-rw-r--r-- | src/fw_actor.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fw_actor.rs b/src/fw_actor.rs index 0fa6e64..ac553b1 100644 --- a/src/fw_actor.rs +++ b/src/fw_actor.rs @@ -32,7 +32,7 @@ impl FirewallActor { fw::setup(&ctx.ipt)?; - return Ok(ctx) + return Ok(ctx); } pub async fn listen(&mut self) -> Result<()> { @@ -40,7 +40,7 @@ impl FirewallActor { loop { // 1. Wait for an event let new_ports = select! { - Some(ports) = self.rx_ports.recv() => Some(ports), + _ = self.rx_ports.changed() => Some(self.rx_ports.borrow().clone()), _ = interval.tick() => None, else => return Ok(()) // Sender dropped, terminate loop. }; @@ -81,6 +81,6 @@ impl FirewallActor { fw::open_ports(&self.ipt, ports_to_open)?; - return Ok(()) + return Ok(()); } } |