aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/upstream.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-01 14:39:41 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-01 14:39:41 +0000
commit58e8c7ee5f5c19f2a954684866357086b83b7662 (patch)
tree2488a29d9f4637ec149d3d0cdb46c0b7f9a9a532 /src/libutil/upstream.c
parentff7f417bffb844100606c17162bf70a2880db223 (diff)
downloadrspamd-58e8c7ee5f5c19f2a954684866357086b83b7662.tar.gz
rspamd-58e8c7ee5f5c19f2a954684866357086b83b7662.zip
[Minor] Fix C stupidity
Diffstat (limited to 'src/libutil/upstream.c')
-rw-r--r--src/libutil/upstream.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c
index 1f7bd1541..227ea4442 100644
--- a/src/libutil/upstream.c
+++ b/src/libutil/upstream.c
@@ -131,23 +131,30 @@ struct upstream_ctx {
INIT_LOG_MODULE(upstream)
/* 4 errors in 10 seconds */
-static const guint default_max_errors = 4;
-static const gdouble default_revive_time = 60;
-static const gdouble default_revive_jitter = 0.4;
-static const gdouble default_error_time = 10;
-static const gdouble default_dns_timeout = 1.0;
-static const guint default_dns_retransmits = 2;
+#define DEFAULT_MAX_ERRORS 4
+static const guint default_max_errors = DEFAULT_MAX_ERRORS;
+#define DEFAULT_REVIVE_TIME 60
+static const gdouble default_revive_time = DEFAULT_REVIVE_TIME;
+#define DEFAULT_REVIVE_JITTER 0.4
+static const gdouble default_revive_jitter = DEFAULT_REVIVE_JITTER;
+#define DEFAULT_ERROR_TIME 10
+static const gdouble default_error_time = DEFAULT_ERROR_TIME;
+#define DEFAULT_DNS_TIMEOUT 1.0
+static const gdouble default_dns_timeout = DEFAULT_DNS_TIMEOUT;
+#define DEFAULT_DNS_RETRANSMITS 2
+static const guint default_dns_retransmits = DEFAULT_DNS_RETRANSMITS;
/* TODO: make it configurable */
-static const gdouble default_lazy_resolve_time = 3600.0;
+#define DEFAULT_LAZY_RESOLVE_TIME 3600.0
+static const gdouble default_lazy_resolve_time = DEFAULT_LAZY_RESOLVE_TIME;
static const struct upstream_limits default_limits = {
- .revive_time = default_revive_time,
- .revive_jitter = default_revive_jitter,
- .error_time = default_error_time,
- .dns_timeout = default_dns_timeout,
- .dns_retransmits = default_dns_retransmits,
- .max_errors = default_max_errors,
- .lazy_resolve_time = default_lazy_resolve_time,
+ .revive_time = DEFAULT_REVIVE_TIME,
+ .revive_jitter = DEFAULT_REVIVE_JITTER,
+ .error_time = DEFAULT_ERROR_TIME,
+ .dns_timeout = DEFAULT_DNS_TIMEOUT,
+ .dns_retransmits = DEFAULT_DNS_RETRANSMITS,
+ .max_errors = DEFAULT_MAX_ERRORS,
+ .lazy_resolve_time = DEFAULT_LAZY_RESOLVE_TIME,
};
static void rspamd_upstream_lazy_resolve_cb (struct ev_loop *, ev_timer *, int );