worker->srv->cfg);
rspamd_upstreams_library_init (ctx->resolver->r, ctx->ev_base);
+ rspamd_upstreams_library_config (worker->srv->cfg);
/* Maps events */
start_map_watch (worker->srv->cfg, ctx->ev_base);
worker->srv->cfg);
rspamd_upstreams_library_init (ctx->resolver->r, ctx->ev_base);
+ rspamd_upstreams_library_config (worker->srv->cfg);
/* Set umask */
umask (S_IWGRP | S_IWOTH | S_IROTH | S_IRGRP);
worker->srv->cfg);
rspamd_upstreams_library_init (ctx->resolver->r, ctx->ev_base);
+ rspamd_upstreams_library_config (worker->srv->cfg);
/* Create classify pool */
ctx->classify_pool = NULL;
struct rspamd_config *cfg;
gint i, success = 0;
const gint assumptions = 100500;
+ gdouble p;
cfg = (struct rspamd_config *)g_malloc (sizeof (struct rspamd_config));
bzero (cfg, sizeof (struct rspamd_config));
}
}
+ p = 1.0 - fabs (3.0 / 4.0 - (gdouble)success / (gdouble)assumptions);
/*
* P value is calculated as following:
* when we add/remove M upstreams from the list, the probability of hash
* miss should be close to the relation N / (N + M), where N is the size of
* the previous upstreams list.
*/
- msg_info ("p value for hash consistency: %.6f", 1.0 - fabs ((3.0 / 4.0 -
- (gdouble)success / (gdouble)assumptions)));
+ msg_info ("p value for hash consistency: %.6f", p);
+ g_assert (p > 0.9);
}