aboutsummaryrefslogtreecommitdiffstats
path: root/src/controller.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-13 17:03:33 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-13 17:03:33 +0100
commit9aac6193c2265ea954fbddd5b3a98ebf0026101f (patch)
tree6daffd464004424f4b4424c351b1ab445d94573e /src/controller.c
parent49c0e94f6569fad2c1f8d1eb20eda79ac2e6b6c8 (diff)
downloadrspamd-9aac6193c2265ea954fbddd5b3a98ebf0026101f.tar.gz
rspamd-9aac6193c2265ea954fbddd5b3a98ebf0026101f.zip
Fix handling of custom commands.
Diffstat (limited to 'src/controller.c')
-rw-r--r--src/controller.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/controller.c b/src/controller.c
index 32b170b76..534db37e8 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -1974,8 +1974,12 @@ rspamd_controller_handle_custom (struct rspamd_http_connection_entry *conn_ent,
{
struct rspamd_controller_session *session = conn_ent->ud;
struct rspamd_custom_controller_command *cmd;
+ gchar *url_str;
+
+ url_str = rspamd_fstring_cstr (msg->url);
+ cmd = g_hash_table_lookup (session->ctx->custom_commands, url_str);
+ g_free (url_str);
- cmd = g_hash_table_lookup (session->ctx->custom_commands, msg->url->str);
if (cmd == NULL || cmd->handler == NULL) {
msg_err_session ("custom command %V has not been found", msg->url);
rspamd_controller_send_error (conn_ent, 404, "No command associated");