commit daaf863

default  ·  2023-05-05 10:47:17 +0000 UTC
parent 8cd79df
The 'ping' command-line requests the actor for better error info.
1 files changed,  +13, -5
M main.c
M main.c
+13, -5
 1@@ -230,13 +230,21 @@ int main(int argc, char *argv[])
 2     }
 3 
 4     if (strcmp(cmd, "ping") == 0) {
 5-        xs *msg = msg_ping(&snac, url);
 6+        xs *actor_o = NULL;
 7 
 8-        enqueue_output_by_actor(&snac, msg, url, 0);
 9+        if (valid_status(actor_request(&snac, url, &actor_o))) {
10+            xs *msg = msg_ping(&snac, url);
11 
12-        if (dbglevel) {
13-            xs *j = xs_json_dumps_pp(msg, 4);
14-            printf("%s\n", j);
15+            enqueue_output_by_actor(&snac, msg, url, 0);
16+
17+            if (dbglevel) {
18+                xs *j = xs_json_dumps_pp(msg, 4);
19+                printf("%s\n", j);
20+            }
21+        }
22+        else {
23+            srv_log(xs_fmt("Error getting actor %s", url));
24+            return 1;
25         }
26 
27         return 0;