diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-01-30 00:56:18 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-01-30 00:56:18 +0000 |
commit | 7190809e19680ec753e3bde866f0c3f81fafae21 (patch) | |
tree | add4ca7732a5f9e4949dc12396447e83683b3b84 /src/client/rspamdclient.c | |
parent | 023abb060f52cb2f401905dfbb4e2ce0af271273 (diff) | |
download | rspamd-7190809e19680ec753e3bde866f0c3f81fafae21.tar.gz rspamd-7190809e19680ec753e3bde866f0c3f81fafae21.zip |
Fix peer keys handling.
Diffstat (limited to 'src/client/rspamdclient.c')
-rw-r--r-- | src/client/rspamdclient.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c index 3073b85bf..1df619437 100644 --- a/src/client/rspamdclient.c +++ b/src/client/rspamdclient.c @@ -39,7 +39,7 @@ struct rspamd_client_request; struct rspamd_client_connection { gint fd; GString *server_name; - GString *key; + gpointer key; gpointer keypair; struct event_base *ev_base; struct timeval timeout; @@ -165,7 +165,7 @@ rspamd_client_init (struct event_base *ev_base, const gchar *name, conn->key = rspamd_http_connection_make_peer_key (key); if (conn->key) { conn->keypair = rspamd_http_connection_gen_key (); - rspamd_http_connection_set_key (conn->http_conn, conn->key); + rspamd_http_connection_set_key (conn->http_conn, conn->keypair); } else { rspamd_client_destroy (conn); @@ -194,7 +194,7 @@ rspamd_client_command (struct rspamd_client_connection *conn, req->msg = rspamd_http_new_message (HTTP_REQUEST); if (conn->key) { - req->msg->peer_key = g_string_new (conn->key->str); + req->msg->peer_key = rspamd_http_connection_key_ref (conn->key); } if (in != NULL) { @@ -253,7 +253,7 @@ rspamd_client_destroy (struct rspamd_client_connection *conn) } close (conn->fd); if (conn->key) { - g_string_free (conn->key, TRUE); + rspamd_http_connection_key_unref (conn->key); } if (conn->keypair) { rspamd_http_connection_key_unref (conn->keypair); |