diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-03-29 10:50:48 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-03-29 10:50:48 +0200 |
| commit | 9ef8eb65d1bf2e96c678514c1e7e59b57c8ca33d (patch) | |
| tree | a0aa44988e515b0f53a4de1e97bd2a186d629d0e | |
| parent | b42bd2d2383806a147c4e6ec0362dd3823d33c96 (diff) | |
| download | mullvadvpn-9ef8eb65d1bf2e96c678514c1e7e59b57c8ca33d.tar.xz mullvadvpn-9ef8eb65d1bf2e96c678514c1e7e59b57c8ca33d.zip | |
Loop without break
| -rw-r--r-- | talpid_ipc/src/http_ipc.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/talpid_ipc/src/http_ipc.rs b/talpid_ipc/src/http_ipc.rs index a650a6b21c..b9b8580616 100644 --- a/talpid_ipc/src/http_ipc.rs +++ b/talpid_ipc/src/http_ipc.rs @@ -56,13 +56,11 @@ fn start_receive_loop<T, U, F>(mut on_message: F, U: serde::Serialize, F: FnMut(Result<T>) -> U + Send + 'static { - thread::spawn(move || loop { - if should_stop(&stop_rx) { - debug!("Stopping the server"); - break; + thread::spawn(move || { + while !should_stop(&stop_rx) { + receive(&mut on_message, &http_server); } - - receive(&mut on_message, &http_server); + debug!("Stopping the HTTP IPC server"); }); } |
