IF(SUPPORT_WSTRICT_PROTOTYPES)
SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wstrict-prototypes")
ENDIF(SUPPORT_WSTRICT_PROTOTYPES)
-IF(SUPPORT_PEDANTIC_FLAG)
- SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -pedantic")
-ENDIF(SUPPORT_PEDANTIC_FLAG)
+#IF(SUPPORT_PEDANTIC_FLAG)
+# SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -pedantic")
+#ENDIF(SUPPORT_PEDANTIC_FLAG)
IF(SUPPORT_WNULL_DEREFERENCE)
SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wnull-dereference")
ENDIF()
start_row = rrd_result->cur_row == rrd_result->rra_rows - 1 ?
0 : rrd_result->cur_row;
+ t = ts * rrd_result->pdp_per_cdp;
+ k = 0;
/* Create window */
step = (rrd_result->rra_rows / desired_points + 0.5);
}
reply:
- result.tag = cmd->tag;
-
- memcpy (&session->reply.rep, &result, sizeof (result));
-
- rspamd_fuzzy_update_stats (session->ctx,
- session->epoch,
- result.prob > 0.5,
- is_shingle,
- session->key_stat,
- ip_stat, cmd->cmd,
- result.value);
-
- if (encrypted) {
- /* We need also to encrypt reply */
- ottery_rand_bytes (session->reply.hdr.nonce,
- sizeof (session->reply.hdr.nonce));
- rspamd_cryptobox_encrypt_nm_inplace ((guchar *)&session->reply.rep,
- sizeof (session->reply.rep),
- session->reply.hdr.nonce,
- session->nm,
- session->reply.hdr.mac,
- RSPAMD_CRYPTOBOX_MODE_25519);
+ if (cmd) {
+ result.tag = cmd->tag;
+
+ memcpy (&session->reply.rep, &result, sizeof (result));
+
+ rspamd_fuzzy_update_stats (session->ctx,
+ session->epoch,
+ result.prob > 0.5,
+ is_shingle,
+ session->key_stat,
+ ip_stat, cmd->cmd,
+ result.value);
+
+ if (encrypted) {
+ /* We need also to encrypt reply */
+ ottery_rand_bytes (session->reply.hdr.nonce,
+ sizeof (session->reply.hdr.nonce));
+ rspamd_cryptobox_encrypt_nm_inplace ((guchar *)&session->reply.rep,
+ sizeof (session->reply.rep),
+ session->reply.hdr.nonce,
+ session->nm,
+ session->reply.hdr.mac,
+ RSPAMD_CRYPTOBOX_MODE_25519);
+ }
}
rspamd_fuzzy_write_reply (session);
gchar *src = NULL, *psrc;
gsize remain;
gint32 revision, our_rev;
- guint32 len, cnt = 0;
+ guint32 len = 0, cnt = 0;
struct fuzzy_peer_cmd cmd, *pcmd;
enum {
read_len = 0,
const guchar *p = start, *start_section;
guint8 type;
guint flags;
- guint64 sz, comp_sz, uncomp_sz;
+ guint64 sz, comp_sz = 0, uncomp_sz = 0;
struct rspamd_archive *arch;
struct rspamd_archive_file *f;
struct rspamd_rcl_section *
rspamd_rcl_config_init (struct rspamd_config *cfg)
{
- struct rspamd_rcl_section *new = NULL, *sub, *ssub, *sssub;
+ struct rspamd_rcl_section *new = NULL, *sub, *ssub;
/*
* Important notice:
"Maximum score that could be reached by this symbols group");
/* Grouped symbols */
- sssub = rspamd_rcl_add_section_doc (&ssub->subsections,
+ rspamd_rcl_add_section_doc (&ssub->subsections,
"symbol", "name",
rspamd_rcl_symbol_handler,
UCL_OBJECT,
const struct rspamd_fuzzy_cmd *cmd)
{
int rc = -1;
- guint32 flag;
if (backend == NULL) {
return FALSE;
cmd->digest);
if (rc == SQLITE_OK) {
- /* Check flag */
- flag = sqlite3_column_int64 (
- prepared_stmts[RSPAMD_FUZZY_BACKEND_CHECK].stmt,
- 2);
rspamd_fuzzy_backend_cleanup_stmt (backend, RSPAMD_FUZZY_BACKEND_CHECK);
rc = rspamd_fuzzy_backend_run_stmt (backend, TRUE,
gchar *decoded;
gint rc;
gsize decoded_len;
- gboolean has_spaces = FALSE;
const gchar *p;
gchar *t, *h;
p ++;
start ++;
len --;
- has_spaces = TRUE;
}
if (comp) {
if (comp) {
comp->len --;
}
- has_spaces = TRUE;
}
/* Also we need to perform url decode */
rspamd_min_heap_index (struct rspamd_min_heap *heap, guint idx)
{
g_assert (heap != NULL);
- g_assert (idx >= 0 && idx < heap->ar->len);
+ g_assert (idx < heap->ar->len);
return g_ptr_array_index (heap->ar, idx);
}
g_ptr_array_add (map->backends, bk);
if (!map->name) {
- map->name = g_strdup (ucl_object_tostring (cur));
+ map->name = g_strdup (ucl_object_tostring (elt));
}
}
}
}
#else
if (mp->cnt > 0) {
- mp->t = acism_create (mp->pats->data, mp->cnt);
+ mp->t = acism_create ((const ac_trie_pat_t *)mp->pats->data, mp->cnt);
}
#endif
mp->compiled = TRUE;
}
}
else {
- guint64 res[SHINGLES_WINDOW * RSPAMD_SHINGLE_SIZE];
+ guint64 res[SHINGLES_WINDOW * RSPAMD_SHINGLE_SIZE], seed;
switch (alg) {
case RSPAMD_SHINGLES_XXHASH:
word = &g_array_index (input, rspamd_ftok_t, beg);
/* Insert the last element to the pipe */
+ memcpy (&seed, keys[j], sizeof (seed));
res[j * SHINGLES_WINDOW + SHINGLES_WINDOW - 1] =
rspamd_cryptobox_fast_hash_specific (ht,
word->begin, word->len,
- *(guint64 *)keys[j]);
+ seed);
val = 0;
for (k = 0; k < SHINGLES_WINDOW; k ++) {
- val ^= res[j * SHINGLES_WINDOW + k] >> (8 * (SHINGLES_WINDOW - k - 1));
+ val ^= res[j * SHINGLES_WINDOW + k] >>
+ (8 * (SHINGLES_WINDOW - k - 1));
}
g_assert (hlen > beg);
read_semicolon
} state = read_key;
gsize keylen = 0, *valuelen, clslen;
- gint idx, t;
+ gint idx = 0, t;
g_assert (extraction_pattern != NULL);