void
remove_all_maps (void)
{
- GList *cur = maps;
- struct rspamd_map *map;
-
- /* First of all do synced read of data */
- while (cur) {
- map = cur->data;
- cur = g_list_next (cur);
- }
g_list_free (maps);
maps = NULL;
if (map_pool != NULL) {
GByteArray *
strip_html_tags (struct worker_task *task, memory_pool_t * pool, struct mime_text_part *part, GByteArray * src, gint *stateptr)
{
- uint8_t *tbuf = NULL, *p, *tp = NULL, *rp, *tbegin = NULL, *end, c, lc;
+ uint8_t *p, *rp, *tbegin = NULL, *end, c, lc;
gint br, i = 0, depth = 0, in_q = 0;
gint state = 0;
GByteArray *buf;
case 2: /* PHP */
if (!br && lc != '\"' && *(p - 1) == '?') {
in_q = state = 0;
- tp = tbuf;
}
break;
case 3:
in_q = state = 0;
- tp = tbuf;
break;
case 4: /* JavaScript/CSS/etc... */
if (p >= src->data + 2 && *(p - 1) == '-' && *(p - 2) == '-') {
in_q = state = 0;
- tp = tbuf;
}
break;
json_error_t je;
gchar *cur_rule, *cur_symbol;
double score;
- gboolean enabled;
struct regexp_module_item *cur_item;
GList *cur_networks = NULL;
struct dynamic_map_item *cur_nitem;
for (i = 0; i < nelts; i++) {
cur_networks = NULL;
cur_rule = NULL;
- enabled = TRUE;
cur_elt = json_array_get (js, i);
if (!cur_elt || !json_is_object (cur_elt)) {
struct redirector_param *param = data;
struct worker_task *task;
struct uri *url = value;
- f_str_t f;
gchar *red_domain;
const gchar *pos;
GRegex *re;
}
if (surbl_module_ctx->use_redirector) {
- f.begin = url->host;
- f.len = url->hostlen;
/* Search in trie */
if (surbl_module_ctx->redirector_trie &&
(pos = rspamd_trie_lookup (surbl_module_ctx->redirector_trie, url->host, url->hostlen, &idx)) != NULL &&
gint
rspamd_fprintf (FILE *f, const gchar *fmt, ...)
{
- gchar *p;
va_list args;
gchar buf[BUFSIZ];
gint r;
va_start (args, fmt);
- p = rspamd_vsnprintf (buf, sizeof (buf), fmt, args);
+ rspamd_vsnprintf (buf, sizeof (buf), fmt, args);
va_end (args);
r = fprintf (f, "%s", buf);
size_t len, slen;
gint64 i64;
guint64 ui64;
- guint width, sign, hex, humanize, bytes, max_width, frac_width, i;
+ guint width, sign, hex, humanize, bytes, frac_width, i;
f_str_t *v;
GString *gs;
hex = 0;
bytes = 0;
humanize = 0;
- max_width = 0;
frac_width = 0;
slen = (size_t) -1;
continue;
case 'm':
- max_width = 1;
fmt++;
continue;
{
guint32 bit;
radix_node_t *node;
- radix_node_t *tmp;
bit = 0x80000000;
node = tree->root;
node->parent->left = NULL;
}
- tmp = node;
node = node->parent;
if (node->right || node->left) {
GList *cur;
enum rspamd_metric_action r = METRIC_ACTION_NOACTION;
gboolean black;
- double rej = 0.;
if (us != NULL) {
/* Check whitelist and set appropriate action for whitelisted users */
r = act->action;
sel = act;
}
- if (r == METRIC_ACTION_REJECT) {
- rej = act->score;
- }
cur = g_list_next (cur);
}
}
static void
statfile_preload (stat_file_t *file)
{
- guint8 *pos, *end, t;
+ guint8 *pos, *end;
+ volatile guint8 t;
gsize size;
pos = (guint8 *)file->map;
#endif
while (pos < end) {
t = *pos;
+ (void)t;
pos += size;
}
}
statfile_pool_get_block (statfile_pool_t * pool, stat_file_t * file, guint32 h1, guint32 h2, time_t now)
{
struct stat_file_block *block;
- struct stat_file_header *header;
guint i, blocknum;
u_char *c;
}
blocknum = h1 % file->cur_section.length;
- header = (struct stat_file_header *)file->map;
c = (u_char *) file->map + file->seek_pos + blocknum * sizeof (struct stat_file_block);
block = (struct stat_file_block *)c;
struct upstream *
get_upstream_round_robin (void *ups, size_t members, size_t msize, time_t now, time_t error_timeout, time_t revive_timeout, size_t max_errors)
{
- guint alive, max_weight, i;
+ guint max_weight, i;
struct upstream *cur, *selected = NULL;
u_char *p;
/* Recheck all upstreams */
- alive = rescan_upstreams (ups, members, msize, now, error_timeout, revive_timeout, max_errors);
+ (void)rescan_upstreams (ups, members, msize, now, error_timeout, revive_timeout, max_errors);
p = ups;
max_weight = 0;
struct upstream *
get_upstream_master_slave (void *ups, size_t members, size_t msize, time_t now, time_t error_timeout, time_t revive_timeout, size_t max_errors)
{
- guint alive, max_weight, i;
+ guint max_weight, i;
struct upstream *cur, *selected = NULL;
u_char *p;
/* Recheck all upstreams */
- alive = rescan_upstreams (ups, members, msize, now, error_timeout, revive_timeout, max_errors);
+ (void)rescan_upstreams (ups, members, msize, now, error_timeout, revive_timeout, max_errors);
p = ups;
max_weight = 0;
gint
make_socketpair (gint pair[2])
{
- gint s_error, r, optlen, serrno, on = 1;
+ gint r;
r = socketpair (PF_LOCAL, SOCK_STREAM, 0, pair);
return 0;
out:
- serrno = errno;
close (pair[0]);
close (pair[1]);
- errno = serrno;
return (-1);
}