diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-09 22:42:27 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-09 22:42:27 +0000 |
commit | 1235838bdcc376953df267f6ec09d349d351d110 (patch) | |
tree | 2089175599df5c533c8f429aca5ceca8dbbf48df /src/cfg_xml.c | |
parent | b0684dcde39eac33709c16ee27db197a1dfa5724 (diff) | |
download | rspamd-1235838bdcc376953df267f6ec09d349d351d110.tar.gz rspamd-1235838bdcc376953df267f6ec09d349d351d110.zip |
Remove dead code.
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r-- | src/cfg_xml.c | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c index e301696d3..b8b75b715 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -755,125 +755,6 @@ process_attrs (const gchar **attribute_names, const gchar **attribute_values, uc /* Handlers */ -gboolean -handle_composite (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset) -{ - gchar *val; - struct expression *expr; - struct rspamd_composite *composite; - - if (attrs == NULL || (val = g_hash_table_lookup (attrs, "name")) == NULL) { - msg_err ("'name' attribute is required for tag 'composite'"); - return FALSE; - } - - if ((expr = parse_expression (cfg->cfg_pool, data)) == NULL) { - msg_err ("cannot parse composite expression: %s", data); - return FALSE; - } - composite = memory_pool_alloc (cfg->cfg_pool, sizeof (struct rspamd_composite)); - composite->expr = expr; - composite->id = g_hash_table_size (cfg->composite_symbols) + 1; - g_hash_table_insert (cfg->composite_symbols, val, composite); - register_virtual_symbol (&cfg->cache, val, 1); - - return TRUE; -} - -/* View section */ - -/* Classifier */ -gboolean -handle_classifier_tokenizer (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset) -{ - struct classifier_config *ccf = ctx->section_pointer; - - if ((ccf->tokenizer = get_tokenizer (data)) == NULL) { - msg_err ("unknown tokenizer %s", data); - return FALSE; - } - - return TRUE; -} - -/* Statfile */ -gboolean -handle_statfile_normalizer (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset) -{ - msg_info ("normalizer option is now not available as rspamd always use internal normalizer for winnow (hyperbolic tanhent)"); - return TRUE; -} - -gboolean -handle_statfile_binlog (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset) -{ - struct statfile *st = ctx->section_pointer; - - if (st->binlog == NULL) { - st->binlog = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct statfile_binlog_params)); - } - if (g_ascii_strcasecmp (data, "master") == 0) { - st->binlog->affinity = AFFINITY_MASTER; - } - else if (g_ascii_strcasecmp (data, "slave") == 0) { - st->binlog->affinity = AFFINITY_SLAVE; - } - else { - st->binlog->affinity = AFFINITY_NONE; - } - - return TRUE; -} - -gboolean -handle_statfile_binlog_rotate (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset) -{ - struct statfile *st = ctx->section_pointer; - - if (st->binlog == NULL) { - st->binlog = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct statfile_binlog_params)); - } - st->binlog->rotate_time = cfg_parse_time (data, TIME_SECONDS); - - return TRUE; -} - -gboolean -handle_statfile_binlog_master (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset) -{ - struct statfile *st = ctx->section_pointer; - if (st->binlog == NULL) { - st->binlog = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct statfile_binlog_params)); - } - - if (!parse_host_port (cfg->cfg_pool, data, &st->binlog->master_addr, &st->binlog->master_port)) { - msg_err ("cannot parse master address: %s", data); - return FALSE; - } - - return TRUE; -} - -gboolean -handle_statfile_opt (struct config_file *cfg, struct rspamd_xml_userdata *ctx, const gchar *tag, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset) -{ - struct statfile *st = ctx->section_pointer; - const gchar *name; - - if (g_ascii_strcasecmp (tag, "option") == 0 || g_ascii_strcasecmp (tag, "param") == 0) { - if (attrs == NULL || (name = g_hash_table_lookup (attrs, "name")) == NULL) { - msg_err ("worker param tag must have \"name\" attribute"); - return FALSE; - } - } - else { - name = memory_pool_strdup (cfg->cfg_pool, tag); - } - - g_hash_table_insert (st->opts, (char *)name, memory_pool_strdup (cfg->cfg_pool, data)); - - return TRUE; -} /* XML callbacks */ void |