timeout =
rspamd_mempool_alloc (param->task->task_pool,
sizeof (struct timeval));
- timeout->tv_sec = surbl_module_ctx->read_timeout / 1000;
- timeout->tv_usec =
- (surbl_module_ctx->read_timeout - timeout->tv_sec *
- 1000) * 1000;
+ double_to_tv (surbl_module_ctx->read_timeout, timeout);
event_del (¶m->ev);
event_set (¶m->ev,
param->sock,
param->buf = g_string_sized_new (1024);
param->tree = tree;
timeout = rspamd_mempool_alloc (task->task_pool, sizeof (struct timeval));
- timeout->tv_sec = surbl_module_ctx->connect_timeout / 1000;
- timeout->tv_usec =
- (surbl_module_ctx->connect_timeout - timeout->tv_sec * 1000) * 1000;
+ double_to_tv (surbl_module_ctx->connect_timeout, timeout);
event_set (¶m->ev, s, EV_WRITE, redirector_callback, (void *)param);
event_add (¶m->ev, timeout);
register_async_event (task->s,
#define DEFAULT_REDIRECTOR_PORT 8080
#define DEFAULT_SURBL_WEIGHT 10
-#define DEFAULT_REDIRECTOR_CONNECT_TIMEOUT 1000
-#define DEFAULT_REDIRECTOR_READ_TIMEOUT 5000
+#define DEFAULT_REDIRECTOR_CONNECT_TIMEOUT 1.0
+#define DEFAULT_REDIRECTOR_READ_TIMEOUT 5.0
#define DEFAULT_SURBL_MAX_URLS 1000
#define DEFAULT_SURBL_URL_EXPIRE 86400
#define DEFAULT_SURBL_SYMBOL "SURBL_DNS"
struct surbl_ctx {
gint (*filter)(struct rspamd_task *task);
guint16 weight;
- guint connect_timeout;
- guint read_timeout;
+ gdouble connect_timeout;
+ gdouble read_timeout;
guint max_urls;
guint url_expire;
GList *suffixes;