mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
The 'ping' command-line requests the actor for better error info.
This commit is contained in:
parent
8cd79df272
commit
daaf863d83
1 changed files with 13 additions and 5 deletions
8
main.c
8
main.c
|
@ -230,6 +230,9 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(cmd, "ping") == 0) {
|
if (strcmp(cmd, "ping") == 0) {
|
||||||
|
xs *actor_o = NULL;
|
||||||
|
|
||||||
|
if (valid_status(actor_request(&snac, url, &actor_o))) {
|
||||||
xs *msg = msg_ping(&snac, url);
|
xs *msg = msg_ping(&snac, url);
|
||||||
|
|
||||||
enqueue_output_by_actor(&snac, msg, url, 0);
|
enqueue_output_by_actor(&snac, msg, url, 0);
|
||||||
|
@ -238,6 +241,11 @@ int main(int argc, char *argv[])
|
||||||
xs *j = xs_json_dumps_pp(msg, 4);
|
xs *j = xs_json_dumps_pp(msg, 4);
|
||||||
printf("%s\n", j);
|
printf("%s\n", j);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
srv_log(xs_fmt("Error getting actor %s", url));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue