summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--talpid_ipc/src/http_ipc.rs10
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");
});
}