void *data;
struct rdns_upstream_elt* (*select)(const char *name,
size_t len, void *ups_data);
- struct rdns_upstream_elt* (*select_retransmit)(const char *name,
- size_t len, void *ups_data);
+ struct rdns_upstream_elt* (*select_retransmit)(const char *name, size_t len,
+ struct rdns_upstream_elt* prev_elt,
+ void *ups_data);
unsigned int (*count)(void *ups_data);
void (*ok)(struct rdns_upstream_elt *elt, void *ups_data);
void (*fail)(struct rdns_upstream_elt *elt, void *ups_data);
req->retransmits --;
resolver = req->resolver;
+ if (req->resolver->ups && req->io->srv->ups_elt) {
+ req->resolver->ups->fail (req->io->srv->ups_elt,
+ req->resolver->ups->data);
+ }
+ else {
+ UPSTREAM_FAIL (req->io->srv, time (NULL));
+ }
+
if (req->retransmits == 0) {
- if (req->resolver->ups && req->io->srv->ups_elt) {
- req->resolver->ups->fail (req->io->srv->ups_elt,
- req->resolver->ups->data);
- }
- else {
- UPSTREAM_FAIL (req->io->srv, time (NULL));
- }
rep = rdns_make_reply (req, RDNS_RC_TIMEOUT);
rdns_request_unschedule (req);
if (resolver->ups) {
struct rdns_upstream_elt *elt;
- elt = resolver->ups->select_retransmit (req->requested_names[0].name,
- req->requested_names[0].len, resolver->ups->data);
+ elt = resolver->ups->select_retransmit (
+ req->requested_names[0].name,
+ req->requested_names[0].len,
+ req->io->srv->ups_elt,
+ resolver->ups->data);
if (elt) {
serv = elt->server;
size_t len, void *ups_data);
static struct rdns_upstream_elt* rspamd_dns_select_upstream_retransmit (
const char *name,
- size_t len, void *ups_data);
+ size_t len,
+ struct rdns_upstream_elt *prev_elt,
+ void *ups_data);
static void rspamd_dns_upstream_ok (struct rdns_upstream_elt *elt,
void *ups_data);
static void rspamd_dns_upstream_fail (struct rdns_upstream_elt *elt,
static struct rdns_upstream_elt*
rspamd_dns_select_upstream_retransmit (
const char *name,
- size_t len, void *ups_data)
+ size_t len,
+ struct rdns_upstream_elt *prev_elt,
+ void *ups_data)
{
struct upstream_list *ups = ups_data;
struct upstream *up;