]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Rspamadm: Do not crash when control path is not reachable
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 11 Aug 2019 08:23:57 +0000 (09:23 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 11 Aug 2019 08:23:57 +0000 (09:23 +0100)
src/rspamadm/control.c

index 2cc783c66d53a4e3a0df1a7d5f047fe87e5d3dd1..cdc5044565f3aea8e4f8471abd2f9f990883f494 100644 (file)
@@ -233,6 +233,13 @@ rspamadm_control (gint argc, gchar **argv, const struct rspamadm_command *_cmd)
                        rspamd_control_finish_handler,
                        RSPAMD_HTTP_CLIENT_SIMPLE,
                        addr);
+
+       if (!conn) {
+               rspamd_fprintf (stderr, "cannot open connection to %s: %s\n",
+                               control_path, strerror (errno));
+               exit (-errno);
+       }
+
        msg = rspamd_http_new_message (HTTP_REQUEST);
        msg->url = rspamd_fstring_new_init (path, strlen (path));