aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/rspamc.c5
-rw-r--r--src/client/rspamdclient.c3
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) {