diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-11 09:23:57 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-11 09:23:57 +0100 |
commit | a7c906a2ae3381e20d1c30a318e519c9c9310128 (patch) | |
tree | b87b8b90cc7a03b7ecdc62abd352ff21d0212d66 /src/rspamadm | |
parent | 68d4ae45572f4a5c2c52cd162cc2a050d75a66c9 (diff) | |
download | rspamd-a7c906a2ae3381e20d1c30a318e519c9c9310128.tar.gz rspamd-a7c906a2ae3381e20d1c30a318e519c9c9310128.zip |
[Minor] Rspamadm: Do not crash when control path is not reachable
Diffstat (limited to 'src/rspamadm')
-rw-r--r-- | src/rspamadm/control.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rspamadm/control.c b/src/rspamadm/control.c index 2cc783c66..cdc504456 100644 --- a/src/rspamadm/control.c +++ b/src/rspamadm/control.c @@ -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)); |