diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-15 21:40:51 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-15 21:40:51 +0000 |
commit | 57d1fc752a122e2fa3a89ec3d01e1c7a555de2fa (patch) | |
tree | f4643b346b2e9ef7569f6554059891219b6e6a48 /src/client/rspamdclient.c | |
parent | 61ba512c5d8b5cce43a8d78630cfe5ee9c0768b0 (diff) | |
download | rspamd-57d1fc752a122e2fa3a89ec3d01e1c7a555de2fa.tar.gz rspamd-57d1fc752a122e2fa3a89ec3d01e1c7a555de2fa.zip |
Allow multiple headers with the same name
Diffstat (limited to 'src/client/rspamdclient.c')
-rw-r--r-- | src/client/rspamdclient.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c index 58ea0ad0e..22c822f14 100644 --- a/src/client/rspamdclient.c +++ b/src/client/rspamdclient.c @@ -200,14 +200,15 @@ rspamd_client_init (struct event_base *ev_base, const gchar *name, gboolean rspamd_client_command (struct rspamd_client_connection *conn, - const gchar *command, GHashTable *attrs, + const gchar *command, GQueue *attrs, FILE *in, rspamd_client_callback cb, gpointer ud, GError **err) { struct rspamd_client_request *req; - gchar *p, *hn, *hv; + struct rspamd_http_client_header *nh; + gchar *p; gsize remain, old_len; - GHashTableIter it; + GList *cur; GString *input = NULL; req = g_slice_alloc0 (sizeof (struct rspamd_client_request)); @@ -256,9 +257,12 @@ rspamd_client_command (struct rspamd_client_connection *conn, } /* Convert headers */ - g_hash_table_iter_init (&it, attrs); - while (g_hash_table_iter_next (&it, (gpointer *)&hn, (gpointer *)&hv)) { - rspamd_http_message_add_header (req->msg, hn, hv); + cur = attrs->head; + while (cur != NULL) { + nh = cur->data; + + rspamd_http_message_add_header (req->msg, nh->name, nh->value); + cur = g_list_next (cur); } req->msg->url = rspamd_fstring_append (req->msg->url, "/", 1); |