]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Remove legacy interface
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 26 Mar 2016 21:07:37 +0000 (21:07 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 26 Mar 2016 21:07:37 +0000 (21:07 +0000)
src/libserver/protocol.c
src/libserver/protocol.h
src/libserver/task.h

index fe0a73fb7199a8238b80486fc01350941a339f05..ef1c25b19cc3db503bfe5a0f113207b46ee0fdec 100644 (file)
@@ -91,7 +91,6 @@
 #define NO_LOG_HEADER "Log"
 #define MLEN_HEADER "Message-Length"
 
-static GList *custom_commands = NULL;
 
 static GQuark
 rspamd_protocol_quark (void)
@@ -137,10 +136,8 @@ static gboolean
 rspamd_protocol_handle_url (struct rspamd_task *task,
        struct rspamd_http_message *msg)
 {
-       GList *cur;
        GHashTable *query_args;
        GHashTableIter it;
-       struct custom_command *cmd;
        struct http_parser_url u;
        const gchar *p;
        gsize pathlen;
@@ -225,21 +222,7 @@ rspamd_protocol_handle_url (struct rspamd_task *task,
                }
                break;
        default:
-               cur = custom_commands;
-               while (cur) {
-                       cmd = cur->data;
-                       if (g_ascii_strncasecmp (p, cmd->name, pathlen) == 0) {
-                               task->cmd = CMD_OTHER;
-                               task->custom_cmd = cmd;
-                               break;
-                       }
-                       cur = g_list_next (cur);
-               }
-
-               if (cur == NULL) {
-                       goto err;
-               }
-               break;
+               goto err;
        }
 
        if (u.field_set & (1 << UF_QUERY)) {
@@ -1139,15 +1122,3 @@ rspamd_protocol_write_reply (struct rspamd_task *task)
 
        task->processed_stages |= RSPAMD_TASK_STAGE_REPLIED;
 }
-
-void
-register_protocol_command (const gchar *name, protocol_reply_func func)
-{
-       struct custom_command *cmd;
-
-       cmd = g_malloc (sizeof (struct custom_command));
-       cmd->name = name;
-       cmd->func = func;
-
-       custom_commands = g_list_prepend (custom_commands, cmd);
-}
index a88a482316f2f47e37bbfd39b98cd26be16431ad..766d48dd53e2ee7aa9864022b08e22a67b6a0c9a 100644 (file)
@@ -71,11 +71,4 @@ ucl_object_t * rspamd_protocol_write_ucl (struct rspamd_task *task);
 void rspamd_protocol_write_reply (struct rspamd_task *task);
 
 
-/**
- * Register custom fucntion to extend protocol
- * @param name symbolic name of custom function
- * @param func callback function for writing reply
- */
-void register_protocol_command (const gchar *name, protocol_reply_func func);
-
 #endif
index f293ef10f7b0f96b17e4dd49c9ad60f86a63b7a0..c27d4bcb5d42d416e7d45d7201785dc2e6fd25cc 100644 (file)
@@ -109,19 +109,11 @@ enum rspamd_task_stage {
 #define RSPAMD_TASK_IS_PROCESSED(task) (((task)->processed_stages & RSPAMD_TASK_STAGE_DONE))
 #define RSPAMD_TASK_IS_CLASSIFIED(task) (((task)->processed_stages & RSPAMD_TASK_STAGE_CLASSIFIERS))
 
-typedef gint (*protocol_reply_func)(struct rspamd_task *task);
-
-struct custom_command {
-       const gchar *name;
-       protocol_reply_func func;
-};
-
 /**
  * Worker task structure
  */
 struct rspamd_task {
        struct rspamd_worker *worker;                                   /**< pointer to worker object                                           */
-       struct custom_command *custom_cmd;                              /**< custom command if any                                                      */
        guint processed_stages;                                                 /**< bits of stages that are processed                          */
        enum rspamd_command cmd;                                                /**< command                                                                            */
        gint sock;                                                                              /**< socket descriptor                                                          */