Skip to content

Commit

Permalink
[Minor] Stop support of -t flag in Rspamd
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Jul 2, 2019
1 parent 65e9bfb commit acf6f74
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions src/rspamd.c
Expand Up @@ -281,11 +281,6 @@ config_logger (rspamd_mempool_t *pool, gpointer ud)
{
struct rspamd_main *rspamd_main = ud;

if (config_test) {
/* Explicitly set logger type to console in case of config testing */
rspamd_main->cfg->log_type = RSPAMD_LOG_CONSOLE;
}

rspamd_set_logger (rspamd_main->cfg, g_quark_try_string ("main"),
&rspamd_main->logger, rspamd_main->server_pool);

Expand Down Expand Up @@ -1196,11 +1191,11 @@ main (gint argc, gchar **argv, gchar **env)
}
}

if (config_test || is_debug) {
if (is_debug) {
rspamd_main->cfg->log_level = G_LOG_LEVEL_DEBUG;
}
else {
rspamd_main->cfg->log_level = G_LOG_LEVEL_WARNING;
rspamd_main->cfg->log_level = G_LOG_LEVEL_MESSAGE;
}

type = g_quark_from_static_string ("main");
Expand Down Expand Up @@ -1243,33 +1238,22 @@ main (gint argc, gchar **argv, gchar **env)

if (encrypt_password) {
do_encrypt_password ();
exit (EXIT_SUCCESS);
exit (EXIT_FAILURE);
}

rspamd_log_close_priv (rspamd_main->logger, FALSE,
rspamd_main->workers_uid, rspamd_main->workers_gid);

if (config_test || dump_cache) {
if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, FALSE, 0,
FALSE)) {
exit (EXIT_FAILURE);
}

res = TRUE;

if (!rspamd_symcache_validate (rspamd_main->cfg->cache,
rspamd_main->cfg,
FALSE)) {
res = FALSE;
}

if (dump_cache) {
msg_err_main ("Use rspamc counters for dumping cache");
exit (EXIT_FAILURE);
}

fprintf (stderr, "syntax %s\n", res ? "OK" : "BAD");
return res ? EXIT_SUCCESS : EXIT_FAILURE;
if (config_test) {
msg_err_main ("Use rspamadm configtest to check config");
}

exit (EXIT_FAILURE);
}

sqlite3_initialize ();
Expand Down

0 comments on commit acf6f74

Please sign in to comment.