diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-06-11 12:47:21 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-06-11 12:58:07 +0200 |
commit | 04547fe158fe05f97ccf584332319da3e6b344d8 (patch) | |
tree | 904a8716d3261c53c199a967fbc651b33430db2b /src/client.c | |
parent | worker_queue: fix worker_queue_add_last (diff) | |
download | cimple-04547fe158fe05f97ccf584332319da3e6b344d8.tar.gz cimple-04547fe158fe05f97ccf584332319da3e6b344d8.zip |
msg: rework some APIs
Diffstat (limited to 'src/client.c')
-rw-r--r-- | src/client.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/client.c b/src/client.c index 8cfb1d1..d7c1b58 100644 --- a/src/client.c +++ b/src/client.c @@ -39,17 +39,13 @@ void client_destroy(struct client *client) int client_main(UNUSED const struct client *client, const struct settings *settings, const char **argv) { - struct msg *request = NULL, *response = NULL; + struct msg *response = NULL; int ret = 0; - ret = msg_from_argv(&request, argv); + ret = msg_connect_and_talk_argv(settings->host, settings->port, argv, &response); if (ret < 0) return ret; - ret = msg_connect_and_communicate(settings->host, settings->port, request, &response); - if (ret < 0) - goto free_request; - if (!msg_is_success(response)) { log_err("Server failed to process the request\n"); msg_dump(response); @@ -60,8 +56,5 @@ int client_main(UNUSED const struct client *client, const struct settings *setti free_response: msg_free(response); -free_request: - msg_free(request); - return ret; } |