summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/main.c b/main.c
index c44b527..3f34673 100644
--- a/main.c
+++ b/main.c
@@ -230,13 +230,21 @@ int main(int argc, char *argv[])
230 } 230 }
231 231
232 if (strcmp(cmd, "ping") == 0) { 232 if (strcmp(cmd, "ping") == 0) {
233 xs *msg = msg_ping(&snac, url); 233 xs *actor_o = NULL;
234 234
235 enqueue_output_by_actor(&snac, msg, url, 0); 235 if (valid_status(actor_request(&snac, url, &actor_o))) {
236 xs *msg = msg_ping(&snac, url);
236 237
237 if (dbglevel) { 238 enqueue_output_by_actor(&snac, msg, url, 0);
238 xs *j = xs_json_dumps_pp(msg, 4); 239
239 printf("%s\n", j); 240 if (dbglevel) {
241 xs *j = xs_json_dumps_pp(msg, 4);
242 printf("%s\n", j);
243 }
244 }
245 else {
246 srv_log(xs_fmt("Error getting actor %s", url));
247 return 1;
240 } 248 }
241 249
242 return 0; 250 return 0;