aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/server.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-04 16:43:52 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-04 16:47:08 +0200
commit4a0b974b85f36011fb1a8c17bf59bc272d96a522 (patch)
treefc05115a4e0f1b37cfd1733acdf1981c3005ae03 /src/server.c
parentsqlite: store new runs in SQLite (diff)
downloadcimple-4a0b974b85f36011fb1a8c17bf59bc272d96a522.tar.gz
cimple-4a0b974b85f36011fb1a8c17bf59bc272d96a522.zip
tcp_server: always clean up connection descriptors
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server.c b/src/server.c
index 678f1c9..ee605c0 100644
--- a/src/server.c
+++ b/src/server.c
@@ -10,6 +10,7 @@
#include "compiler.h"
#include "const.h"
#include "event_loop.h"
+#include "file.h"
#include "log.h"
#include "msg.h"
#include "run_queue.h"
@@ -221,6 +222,11 @@ static int server_handle_cmd_new_worker(UNUSED const struct msg *request,
struct worker *worker = NULL;
int ret = 0;
+ ret = file_dup(client_fd);
+ if (ret < 0)
+ return ret;
+ client_fd = ret;
+
ret = worker_create(&worker, client_fd);
if (ret < 0)
return ret;