From 0dfc98f7ca4f6bfd5bd918f62b467069414778f0 Mon Sep 17 00:00:00 2001 From: Quanwei Zhou Date: Mon, 23 Sep 2024 16:09:00 +0800 Subject: [PATCH] server: fix server exit once a accept failed If the Accept error occurs, an error can be output to ensure that the subsequent connect can be accepted normally. Fixes: #239 Signed-off-by: Quanwei Zhou --- src/sync/server.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sync/server.rs b/src/sync/server.rs index 7eebab7a..867ba36d 100644 --- a/src/sync/server.rs +++ b/src/sync/server.rs @@ -427,7 +427,7 @@ impl Server { Ok(fd) => fd, Err(e) => { error!("failed to accept error {:?}", e); - break; + continue; } }; @@ -439,13 +439,13 @@ impl Server { Ok(fd) => { if let Err(err) = set_fd_close_exec(fd) { error!("fcntl failed after accept: {:?}", err); - break; + continue; }; fd } Err(e) => { error!("failed to accept error {:?}", e); - break; + continue; } };