snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit daaf863d83acd8638a29b8bbf9d6bedb7fae40f2
parent 8cd79df272645da70cfe2980d6f9c0c33c13e452
Author: default <nobody@localhost>
Date:   Fri,  5 May 2023 12:47:17 +0200

The 'ping' command-line requests the actor for better error info.

Diffstat:
Mmain.c | 18+++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/main.c b/main.c @@ -230,13 +230,21 @@ int main(int argc, char *argv[]) } if (strcmp(cmd, "ping") == 0) { - xs *msg = msg_ping(&snac, url); + xs *actor_o = NULL; - enqueue_output_by_actor(&snac, msg, url, 0); + if (valid_status(actor_request(&snac, url, &actor_o))) { + xs *msg = msg_ping(&snac, url); - if (dbglevel) { - xs *j = xs_json_dumps_pp(msg, 4); - printf("%s\n", j); + enqueue_output_by_actor(&snac, msg, url, 0); + + if (dbglevel) { + xs *j = xs_json_dumps_pp(msg, 4); + printf("%s\n", j); + } + } + else { + srv_log(xs_fmt("Error getting actor %s", url)); + return 1; } return 0;