]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve error message + fix misprint
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2020 19:58:04 +0000 (20:58 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2020 19:58:04 +0000 (20:58 +0100)
Issue: #3328

src/client/rspamc.c
src/client/rspamdclient.c

index 5af3c8951976f344e579d239f1e519968815413f..99bff19c8934f24a62fcd2b551218fd99f524ffa 100644 (file)
@@ -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);
index e65a6935c4b7b0a90154f0ca16041d027ee191aa..e281816eda6bf07f99c997da778e935b18d7e8f8 100644 (file)
@@ -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) {