From 9aac6193c2265ea954fbddd5b3a98ebf0026101f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 13 Oct 2015 17:03:33 +0100 Subject: [PATCH] Fix handling of custom commands. --- src/controller.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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"); -- 2.39.5