enum rdns_log_level level,
const char *function, const char *format, ...);
-#define rdns_err(...) do { rdns_logger_helper (resolver, RDNS_LOG_ERROR, __FUNCTION__, __VA_ARGS__); } while (0)
-#define rdns_warn(...) do { rdns_logger_helper (resolver, RDNS_LOG_WARNING, __FUNCTION__, __VA_ARGS__); } while (0)
-#define rdns_info(...) do { rdns_logger_helper (resolver, RDNS_LOG_INFO, __FUNCTION__, __VA_ARGS__); } while (0)
-#define rdns_debug(...) do { rdns_logger_helper (resolver, RDNS_LOG_DEBUG, __FUNCTION__, __VA_ARGS__); } while (0)
+#define rdns_err(...) do { rdns_logger_helper (resolver, RDNS_LOG_ERROR, __func__, __VA_ARGS__); } while (0)
+#define rdns_warn(...) do { rdns_logger_helper (resolver, RDNS_LOG_WARNING, __func__, __VA_ARGS__); } while (0)
+#define rdns_info(...) do { rdns_logger_helper (resolver, RDNS_LOG_INFO, __func__, __VA_ARGS__); } while (0)
+#define rdns_debug(...) do { rdns_logger_helper (resolver, RDNS_LOG_DEBUG, __func__, __VA_ARGS__); } while (0)
#endif /* LOGGER_H_ */
{
XXH_free(statePtr);
return XXH_OK;
-};
+}
XXH64_state_t* XXH64_createState(void)
{
{
XXH_free(statePtr);
return XXH_OK;
-};
+}
/*** Hash feed ***/
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;
while (g_hash_table_iter_next (&it, &k, &v)) {
key = v;
- kp = key->key;
key_stat = key->stat;
if (key_stat) {
#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
{
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) {
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 */
re = arg_pattern->data;
r = rspamd_regexp_search (re, param_data, 0,
NULL, NULL, FALSE, NULL);
+
+ if (r) {
+ return TRUE;
+ }
}
else {
/* Just do strcasecmp */
return FALSE;
}
- if (!whandler->parser.flags & RSPAMD_CL_FLAG_MULTIPLE) {
+ if (!(whandler->parser.flags & RSPAMD_CL_FLAG_MULTIPLE)) {
break;
}
}
}
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,
return FALSE;
}
- if (!cur->pd.flags & RSPAMD_CL_FLAG_MULTIPLE) {
+ if (!(cur->pd.flags & RSPAMD_CL_FLAG_MULTIPLE)) {
break;
}
}
}
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,
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;
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);
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;
switch (t) {
case '<':
p ++;
- tag_start = p;
closing = FALSE;
break;
case '!':
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;
break;
default:
state = sgml_content;
- tag_start = p;
break;
}
break;
case tag_end:
- tag_start = NULL;
substate = 0;
savep = NULL;
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 */
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);
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;
}
if (msg.msg_controllen >= CMSG_SPACE(sizeof (int))) {
- cmsg = CMSG_FIRSTHDR (&msg);
-
rfd = *(int *) CMSG_DATA(CMSG_FIRSTHDR (&msg));
}
{
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,
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);
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);
}
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);
}
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;
-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) {
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;
}
}
}
(gint)new_bit->bit, new_bit->symbol);
g_hash_table_insert (new_suffix->ips, &new_bit->bit,
new_bit);
- has_subsymbols = TRUE;
}
}
}
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;
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++) {
spawn_worker_type (rspamd_main, ev_base, cf);
}
#endif
+ (void)seen_hs_helper; /* Silence warning */
}
static void