aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-15 15:54:43 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-15 15:54:43 +0000
commit27e45bef83fe17b339fe345e3455a67b7416e1d3 (patch)
treea916601653c8eaca9488d7dd55b4de565078047d /src
parent46fd25c4dda2e4cc25f662dc5cb5dad0d4380503 (diff)
downloadrspamd-27e45bef83fe17b339fe345e3455a67b7416e1d3.tar.gz
rspamd-27e45bef83fe17b339fe345e3455a67b7416e1d3.zip
Fix warnings.
Diffstat (limited to 'src')
-rw-r--r--src/fuzzy_storage.c2
-rw-r--r--src/libcryptobox/siphash/siphash.c2
-rw-r--r--src/libmime/mime_expressions.c15
-rw-r--r--src/libserver/cfg_rcl.c6
-rw-r--r--src/libserver/fuzzy_backend.c6
-rw-r--r--src/libserver/html.c7
-rw-r--r--src/libserver/re_cache.c10
-rw-r--r--src/libserver/rspamd_control.c3
-rw-r--r--src/libserver/spf.c2
-rw-r--r--src/lua/lua_util.c6
-rw-r--r--src/lua/lua_xmlrpc.c2
-rw-r--r--src/plugins/surbl.c4
-rw-r--r--src/rspamadm/confighelp.c3
-rw-r--r--src/rspamd.c1
14 files changed, 26 insertions, 43 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 802270383..d204a7c2a 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -864,7 +864,6 @@ rspamd_fuzzy_stat_to_ucl (struct rspamd_fuzzy_storage_ctx *ctx, gboolean ip_stat
GHashTable *ip_hash;
struct fuzzy_key_stat *key_stat;
struct fuzzy_key *key;
- struct rspamd_http_keypair *kp;
rspamd_lru_element_t *lru_elt;
ucl_object_t *obj, *keys_obj, *elt, *ip_elt, *ip_cur;
gpointer k, v;
@@ -878,7 +877,6 @@ rspamd_fuzzy_stat_to_ucl (struct rspamd_fuzzy_storage_ctx *ctx, gboolean ip_stat
while (g_hash_table_iter_next (&it, &k, &v)) {
key = v;
- kp = key->key;
key_stat = key->stat;
if (key_stat) {
diff --git a/src/libcryptobox/siphash/siphash.c b/src/libcryptobox/siphash/siphash.c
index badb6fece..32907292a 100644
--- a/src/libcryptobox/siphash/siphash.c
+++ b/src/libcryptobox/siphash/siphash.c
@@ -27,7 +27,7 @@
#include "platform_config.h"
extern unsigned long cpu_config;
-static const int test_iters = 1000;
+static const size_t test_iters = 1000;
typedef struct siphash_impl_t
{
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c
index be9912463..ad550f3bf 100644
--- a/src/libmime/mime_expressions.c
+++ b/src/libmime/mime_expressions.c
@@ -1560,7 +1560,7 @@ rspamd_content_type_compare_param (struct rspamd_task * task,
GMimeContentType *ct;
gint r;
guint i;
- gboolean recursive = FALSE, result = FALSE;
+ gboolean recursive = FALSE;
struct mime_part *cur_part;
if (args == NULL || args->len < 2) {
@@ -1600,14 +1600,15 @@ rspamd_content_type_compare_param (struct rspamd_task * task,
if ((param_data =
g_mime_content_type_get_parameter ((GMimeContentType *)ct,
- param_name)) == NULL) {
- result = FALSE;
- }
- else {
+ param_name)) != NULL) {
if (arg_pattern->type == EXPRESSION_ARGUMENT_REGEXP) {
re = arg_pattern->data;
r = rspamd_regexp_search (re, param_data, 0,
NULL, NULL, FALSE, NULL);
+
+ if (r) {
+ return TRUE;
+ }
}
else {
/* Just do strcasecmp */
@@ -1745,6 +1746,10 @@ rspamd_content_type_check (struct rspamd_task *task,
re = arg_pattern->data;
r = rspamd_regexp_search (re, param_data, 0,
NULL, NULL, FALSE, NULL);
+
+ if (r) {
+ return TRUE;
+ }
}
else {
/* Just do strcasecmp */
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 27ccb57bc..aafbf5427 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -627,7 +627,7 @@ rspamd_rcl_worker_handler (rspamd_mempool_t *pool, const ucl_object_t *obj,
return FALSE;
}
- if (!whandler->parser.flags & RSPAMD_CL_FLAG_MULTIPLE) {
+ if (!(whandler->parser.flags & RSPAMD_CL_FLAG_MULTIPLE)) {
break;
}
}
@@ -1230,7 +1230,7 @@ rspamd_rcl_add_section (struct rspamd_rcl_section **top,
}
else {
parent_doc = (*top)->doc_ref;
- new->doc_ref = new->doc_ref = rspamd_rcl_add_doc_obj (parent_doc,
+ new->doc_ref = rspamd_rcl_add_doc_obj (parent_doc,
NULL,
name,
type,
@@ -2176,7 +2176,7 @@ rspamd_rcl_section_parse_defaults (struct rspamd_rcl_section *section,
return FALSE;
}
- if (!cur->pd.flags & RSPAMD_CL_FLAG_MULTIPLE) {
+ if (!(cur->pd.flags & RSPAMD_CL_FLAG_MULTIPLE)) {
break;
}
}
diff --git a/src/libserver/fuzzy_backend.c b/src/libserver/fuzzy_backend.c
index b52dae95a..3f0bed465 100644
--- a/src/libserver/fuzzy_backend.c
+++ b/src/libserver/fuzzy_backend.c
@@ -280,7 +280,7 @@ rspamd_fuzzy_backend_run_stmt (struct rspamd_fuzzy_backend *backend,
}
stmt = prepared_stmts[idx].stmt;
- g_assert (prepared_stmts[idx].idx == idx);
+ g_assert ((int)prepared_stmts[idx].idx == idx);
if (stmt == NULL) {
if ((retcode = sqlite3_prepare_v2 (backend->db, prepared_stmts[idx].sql, -1,
@@ -472,7 +472,6 @@ rspamd_fuzzy_backend_check (struct rspamd_fuzzy_backend *backend,
gint64 timestamp;
gint64 shingle_values[RSPAMD_SHINGLE_SIZE], i, sel_id, cur_id,
cur_cnt, max_cnt;
- const char *digest;
if (backend == NULL) {
return rep;
@@ -566,9 +565,6 @@ rspamd_fuzzy_backend_check (struct rspamd_fuzzy_backend *backend,
rc = rspamd_fuzzy_backend_run_stmt (backend, FALSE,
RSPAMD_FUZZY_BACKEND_GET_DIGEST_BY_ID, sel_id);
if (rc == SQLITE_OK) {
- digest = sqlite3_column_text (
- prepared_stmts[RSPAMD_FUZZY_BACKEND_GET_DIGEST_BY_ID].stmt,
- 0);
timestamp = sqlite3_column_int64 (
prepared_stmts[RSPAMD_FUZZY_BACKEND_GET_DIGEST_BY_ID].stmt,
2);
diff --git a/src/libserver/html.c b/src/libserver/html.c
index 5c55d6f30..77de30e8c 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -1661,7 +1661,7 @@ GByteArray*
rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc,
GByteArray *in, GList **exceptions, GHashTable *urls, GHashTable *emails)
{
- const guchar *p, *c, *end, *tag_start = NULL, *savep = NULL;
+ const guchar *p, *c, *end, *savep = NULL;
guchar t;
gboolean closing = FALSE, need_decode = FALSE, save_space = FALSE,
balanced, url_text;
@@ -1735,7 +1735,6 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc,
switch (t) {
case '<':
p ++;
- tag_start = p;
closing = FALSE;
break;
case '!':
@@ -1750,14 +1749,12 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc,
case '/':
closing = TRUE;
p ++;
- tag_start = p;
break;
case '>':
/* Empty tag */
hc->flags |= RSPAMD_HTML_FLAG_BAD_ELEMENTS;
state = tag_end;
p ++;
- tag_start = NULL;
break;
default:
state = tag_content;
@@ -1786,7 +1783,6 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc,
break;
default:
state = sgml_content;
- tag_start = p;
break;
}
@@ -1959,7 +1955,6 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc,
break;
case tag_end:
- tag_start = NULL;
substate = 0;
savep = NULL;
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c
index 94bed145d..4434576c8 100644
--- a/src/libserver/re_cache.c
+++ b/src/libserver/re_cache.c
@@ -539,14 +539,11 @@ rspamd_re_cache_process_regexp_data (struct rspamd_re_runtime *rt,
const guchar *in, gsize len,
gboolean is_raw)
{
- struct rspamd_re_cache_elt *elt;
- struct rspamd_re_class *re_class;
+
guint64 re_id;
guint ret = 0;
re_id = rspamd_regexp_get_cache_id (re);
- elt = g_ptr_array_index (rt->cache->re, re_id);
- re_class = rspamd_regexp_get_class (re);
if (len == 0 || in == NULL) {
/* We assume this as absence of the specified data */
@@ -560,8 +557,13 @@ rspamd_re_cache_process_regexp_data (struct rspamd_re_runtime *rt,
setbit (rt->checked, re_id);
rt->results[re_id] = ret;
#else
+ struct rspamd_re_cache_elt *elt;
+ struct rspamd_re_class *re_class;
struct rspamd_re_hyperscan_cbdata cbdata;
+ elt = g_ptr_array_index (rt->cache->re, re_id);
+ re_class = rspamd_regexp_get_class (re);
+
if (rt->cache->disable_hyperscan || elt->match_type == RSPAMD_RE_CACHE_PCRE) {
ret = rspamd_re_cache_process_pcre (rt, re, in, len, is_raw);
setbit (rt->checked, re_id);
diff --git a/src/libserver/rspamd_control.c b/src/libserver/rspamd_control.c
index e274f100b..6696cd183 100644
--- a/src/libserver/rspamd_control.c
+++ b/src/libserver/rspamd_control.c
@@ -804,7 +804,6 @@ rspamd_srv_request_handler (gint fd, short what, gpointer ud)
struct rspamd_srv_request_data *rd = ud;
struct msghdr msg;
struct iovec iov;
- struct cmsghdr *cmsg;
guchar fdspace[CMSG_SPACE(sizeof (int))];
gssize r;
gint rfd = -1;
@@ -846,8 +845,6 @@ rspamd_srv_request_handler (gint fd, short what, gpointer ud)
}
if (msg.msg_controllen >= CMSG_SPACE(sizeof (int))) {
- cmsg = CMSG_FIRSTHDR (&msg);
-
rfd = *(int *) CMSG_DATA(CMSG_FIRSTHDR (&msg));
}
diff --git a/src/libserver/spf.c b/src/libserver/spf.c
index e8394ec74..31dba5d89 100644
--- a/src/libserver/spf.c
+++ b/src/libserver/spf.c
@@ -429,7 +429,7 @@ spf_record_process_addr (struct spf_record *rec, struct spf_addr *addr, struct
{
struct spf_addr *naddr;
- if (!addr->flags & RSPAMD_SPF_FLAG_PROCESSED) {
+ if (!(addr->flags & RSPAMD_SPF_FLAG_PROCESSED)) {
/* That's the first address */
if (reply->type == RDNS_REQUEST_AAAA) {
memcpy (addr->addr6,
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index a5d3a0f87..eda1ede2b 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -436,7 +436,7 @@ lua_util_tokenize_text (lua_State *L)
struct process_exception *ex;
GArray *res;
rspamd_ftok_t *w;
- gboolean compat = FALSE, check_sig = FALSE;
+ gboolean compat = FALSE;
if (lua_type (L, 1) == LUA_TSTRING) {
in = luaL_checklstring (L, 1, &len);
@@ -485,10 +485,6 @@ lua_util_tokenize_text (lua_State *L)
compat = lua_toboolean (L, 3);
}
- if (lua_gettop (L) > 3 && lua_type (L, 4) == LUA_TBOOLEAN) {
- check_sig = lua_toboolean (L, 4);
- }
-
if (exceptions) {
exceptions = g_list_reverse (exceptions);
}
diff --git a/src/lua/lua_xmlrpc.c b/src/lua/lua_xmlrpc.c
index 64587aae6..2d431ce33 100644
--- a/src/lua/lua_xmlrpc.c
+++ b/src/lua/lua_xmlrpc.c
@@ -414,8 +414,6 @@ xmlrpc_text (GMarkupParseContext *context,
static void
xmlrpc_error (GMarkupParseContext *context, GError *error, gpointer user_data)
{
- struct lua_xmlrpc_ud *ud = user_data;
-
msg_err ("xmlrpc parser error: %s", error->message);
}
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index 480c40d4e..2923b2d45 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -491,7 +491,6 @@ surbl_module_config (struct rspamd_config *cfg)
const gchar *redir_val, *ip_val;
guint32 bit;
gint cb_id, nrules = 0;
- gboolean has_subsymbols;
if (!rspamd_config_is_module_enabled (cfg, "surbl")) {
return TRUE;
@@ -672,7 +671,6 @@ surbl_module_config (struct rspamd_config *cfg)
-1);
nrules++;
new_suffix->callback_id = cb_id;
- has_subsymbols = FALSE;
cur = ucl_obj_get_key (cur_rule, "bits");
if (cur != NULL && cur->type == UCL_OBJECT) {
@@ -701,7 +699,6 @@ surbl_module_config (struct rspamd_config *cfg)
msg_debug_config ("add new bit suffix: %d with symbol: %s",
(gint)new_bit->bit, new_bit->symbol);
g_array_append_val (new_suffix->bits, *new_bit);
- has_subsymbols = TRUE;
}
}
}
@@ -746,7 +743,6 @@ surbl_module_config (struct rspamd_config *cfg)
(gint)new_bit->bit, new_bit->symbol);
g_hash_table_insert (new_suffix->ips, &new_bit->bit,
new_bit);
- has_subsymbols = TRUE;
}
}
}
diff --git a/src/rspamadm/confighelp.c b/src/rspamadm/confighelp.c
index 3b90a4700..43128f11c 100644
--- a/src/rspamadm/confighelp.c
+++ b/src/rspamadm/confighelp.c
@@ -195,7 +195,6 @@ rspamadm_confighelp_search_word (const ucl_object_t *obj, const gchar *str)
static void
rspamadm_confighelp (gint argc, gchar **argv)
{
- struct rspamd_rcl_section *top;
struct rspamd_config *cfg;
ucl_object_t *doc_obj;
const ucl_object_t *elt;
@@ -233,7 +232,7 @@ rspamadm_confighelp (gint argc, gchar **argv)
cfg->compiled_modules = modules;
cfg->compiled_workers = workers;
- top = rspamd_rcl_config_init (cfg);
+ rspamd_rcl_config_init (cfg);
/* Init modules to get documentation strings */
for (pmod = cfg->compiled_modules; pmod != NULL && *pmod != NULL; pmod++) {
diff --git a/src/rspamd.c b/src/rspamd.c
index 3137bb3d7..a71b58810 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -568,6 +568,7 @@ spawn_workers (struct rspamd_main *rspamd_main, struct event_base *ev_base)
spawn_worker_type (rspamd_main, ev_base, cf);
}
#endif
+ (void)seen_hs_helper; /* Silence warning */
}
static void