diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-07 20:58:04 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-07 20:58:04 +0100 |
commit | 050d21d89a4923824a6dc81924c9f53dd29e4739 (patch) | |
tree | 980acfebf78e37a71263d24d4eea623f8d97eef3 | |
parent | 8dfc00bbb4df3bff774eecc806128d09579a7f80 (diff) | |
download | rspamd-050d21d89a4923824a6dc81924c9f53dd29e4739.tar.gz rspamd-050d21d89a4923824a6dc81924c9f53dd29e4739.zip |
[Minor] Improve error message + fix misprint
Issue: #3328
-rw-r--r-- | src/client/rspamc.c | 5 | ||||
-rw-r--r-- | src/client/rspamdclient.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c index 5af3c8951..99bff19c8 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -1725,8 +1725,9 @@ rspamc_process_input (struct ev_loop *ev_base, struct rspamc_command *cmd, } } else { - rspamd_fprintf (stderr, "cannot connect to %s\n", connect_str); - exit (EXIT_FAILURE); + rspamd_fprintf (stderr, "cannot connect to %s: %s\n", connect_str, + strerror (errno)); + exit (-errno); } g_free (hostbuf); diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c index e65a6935c..e281816ed 100644 --- a/src/client/rspamdclient.c +++ b/src/client/rspamdclient.c @@ -264,6 +264,7 @@ rspamd_client_init (struct rspamd_http_context *http_ctx, gint fd; fd = rspamd_socket (name, port, SOCK_STREAM, TRUE, FALSE, TRUE); + if (fd == -1) { return NULL; } @@ -285,7 +286,7 @@ rspamd_client_init (struct rspamd_http_context *http_ctx, } /* Pass socket ownership */ - rspamd_http_connection_own_socket (conn); + rspamd_http_connection_own_socket (conn->http_conn); conn->server_name = g_string_new (name); if (port != 0) { |