From: Vsevolod Stakhov Date: Sat, 9 Nov 2013 22:42:27 +0000 (+0000) Subject: Remove dead code. X-Git-Tag: 0.6.0~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1235838bdcc376953df267f6ec09d349d351d110;p=thirdparty%2Frspamd.git Remove dead code. --- diff --git a/src/cfg_xml.c b/src/cfg_xml.c index e301696d35..b8b75b715e 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