aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-06-13 04:05:32 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-06-13 04:05:32 +0200
commit88ee798f4eafea0c4bf18bd63c2394b6528ea014 (patch)
tree9bcedca215bd4e0c41171d578b72983ea7321b3b
parentsignal: remove the stupid add_to_event_loop wrapper (diff)
downloadcimple-88ee798f4eafea0c4bf18bd63c2394b6528ea014.tar.gz
cimple-88ee798f4eafea0c4bf18bd63c2394b6528ea014.zip
minor refactoring
-rw-r--r--src/server.c16
-rw-r--r--src/worker.c5
2 files changed, 11 insertions, 10 deletions
diff --git a/src/server.c b/src/server.c
index cd77dc8..3d41047 100644
--- a/src/server.c
+++ b/src/server.c
@@ -202,8 +202,8 @@ exit:
return NULL;
}
-static int handle_cmd_new_worker(UNUSED const struct msg *request, UNUSED struct msg **response,
- void *_ctx)
+static int server_handle_cmd_new_worker(UNUSED const struct msg *request,
+ UNUSED struct msg **response, void *_ctx)
{
struct cmd_conn_ctx *ctx = (struct cmd_conn_ctx *)_ctx;
struct server *server = (struct server *)ctx->arg;
@@ -228,7 +228,7 @@ destroy_worker:
return ret;
}
-static int handle_cmd_run(const struct msg *request, struct msg **response, void *_ctx)
+static int server_handle_cmd_run(const struct msg *request, struct msg **response, void *_ctx)
{
struct cmd_conn_ctx *ctx = (struct cmd_conn_ctx *)_ctx;
struct server *server = (struct server *)ctx->arg;
@@ -260,8 +260,8 @@ destroy_run:
return ret;
}
-static int handle_cmd_complete(UNUSED const struct msg *request, UNUSED struct msg **response,
- void *_ctx)
+static int server_handle_cmd_complete(UNUSED const struct msg *request,
+ UNUSED struct msg **response, void *_ctx)
{
struct cmd_conn_ctx *ctx = (struct cmd_conn_ctx *)_ctx;
int client_fd = ctx->fd;
@@ -273,9 +273,9 @@ static int handle_cmd_complete(UNUSED const struct msg *request, UNUSED struct m
}
static struct cmd_desc commands[] = {
- {CMD_NEW_WORKER, handle_cmd_new_worker},
- {CMD_RUN, handle_cmd_run},
- {CMD_COMPLETE, handle_cmd_complete},
+ {CMD_NEW_WORKER, server_handle_cmd_new_worker},
+ {CMD_RUN, server_handle_cmd_run},
+ {CMD_COMPLETE, server_handle_cmd_complete},
};
static const size_t numof_commands = sizeof(commands) / sizeof(commands[0]);
diff --git a/src/worker.c b/src/worker.c
index 03a83c6..8536013 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -80,7 +80,8 @@ static int worker_set_stopping(UNUSED struct event_loop *loop, UNUSED int fd, UN
return 0;
}
-static int worker_handle_run(const struct msg *request, UNUSED struct msg **response, void *_ctx)
+static int worker_handle_cmd_run(const struct msg *request, UNUSED struct msg **response,
+ void *_ctx)
{
struct cmd_conn_ctx *ctx = (struct cmd_conn_ctx *)_ctx;
struct run *run = NULL;
@@ -117,7 +118,7 @@ free_output:
}
static struct cmd_desc commands[] = {
- {CMD_RUN, worker_handle_run},
+ {CMD_RUN, worker_handle_cmd_run},
};
static const size_t numof_commands = sizeof(commands) / sizeof(commands[0]);