gsize dict_len = 0;
void *dict = NULL;
ZSTD_CCtx *zctx;
+ gboolean ret;
req = g_malloc0 (sizeof (struct rspamd_client_request));
req->conn = conn;
conn->start_time = rspamd_get_ticks (FALSE);
if (compressed) {
- rspamd_http_connection_write_message (conn->http_conn, req->msg, NULL,
- "application/x-compressed", req,
+ ret = rspamd_http_connection_write_message (conn->http_conn, req->msg,
+ NULL,"application/x-compressed", req,
conn->timeout);
}
else {
- rspamd_http_connection_write_message (conn->http_conn, req->msg, NULL,
- "text/plain", req, conn->timeout);
+ ret = rspamd_http_connection_write_message (conn->http_conn, req->msg,
+ NULL,"text/plain", req, conn->timeout);
}
- return TRUE;
+ return ret;
}
void
if (fd == -1) {
msg_info ("cannot connect to http proxy %s: %s",
- rspamd_inet_address_to_string (proxy_addr),
+ rspamd_inet_address_to_string_pretty (proxy_addr),
strerror (errno));
rspamd_upstream_fail (up, TRUE);
fd = rspamd_inet_address_connect (addr, SOCK_STREAM, TRUE);
if (fd == -1) {
- msg_info ("cannot connect to proxy %s: %s",
- rspamd_inet_address_to_string (addr),
+ msg_info ("cannot connect make http connection to %s: %s",
+ rspamd_inet_address_to_string_pretty (addr),
strerror (errno));
return NULL;
return meth_len;
}
-static void
+static gboolean
rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn,
struct rspamd_http_message *msg,
const gchar *host,
conn->error_handler (conn, err);
rspamd_http_connection_unref (conn);
g_error_free (err);
- return;
+ return FALSE;
}
else {
if (priv->ssl) {
conn->error_handler (conn, err);
rspamd_http_connection_unref (conn);
g_error_free (err);
- return;
+ return FALSE;
}
}
}
rspamd_http_event_handler, conn);
rspamd_ev_watcher_start (priv->ctx->event_loop, &priv->ev, priv->timeout);
}
+
+ return TRUE;
}
-void
+gboolean
rspamd_http_connection_write_message (struct rspamd_http_connection *conn,
struct rspamd_http_message *msg,
const gchar *host,
gpointer ud,
ev_tstamp timeout)
{
- rspamd_http_connection_write_message_common (conn, msg, host, mime_type,
+ return rspamd_http_connection_write_message_common (conn, msg, host, mime_type,
ud, timeout, FALSE);
}
-void
+gboolean
rspamd_http_connection_write_message_shared (struct rspamd_http_connection *conn,
struct rspamd_http_message *msg,
const gchar *host,
gpointer ud,
ev_tstamp timeout)
{
- rspamd_http_connection_write_message_common (conn, msg, host, mime_type,
+ return rspamd_http_connection_write_message_common (conn, msg, host, mime_type,
ud, timeout, TRUE);
}
* @param ud opaque user data
* @param fd fd to read/write
*/
-void rspamd_http_connection_write_message (
+gboolean rspamd_http_connection_write_message (
struct rspamd_http_connection *conn,
struct rspamd_http_message *msg,
const gchar *host,
gpointer ud,
ev_tstamp timeout);
-void rspamd_http_connection_write_message_shared (
+gboolean rspamd_http_connection_write_message_shared (
struct rspamd_http_connection *conn,
struct rspamd_http_message *msg,
const gchar *host,