summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
77effe1)
Previously, if adns_submit failed:
- the struct query in resolver.c was leaked
- nothing was logged
- the return value from resolver->request was ignored so the site
state machine would hang
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
---
Changes in v2:
* Fixed typo in commit message.
q->answer=cb;
rv=adns_submit(st->ast, name, adns_r_a, 0, q, &q->query);
q->answer=cb;
rv=adns_submit(st->ast, name, adns_r_a, 0, q, &q->query);
+ if (rv) {
+ Message(M_WARNING,
+ "resolver: failed to submit lookup for %s: %s",name,
+ adns_strerror(rv));
+ free(q);
+ return False;
+ }
}
static int resolver_beforepoll(void *sst, struct pollfd *fds, int *nfds_io,
}
static int resolver_beforepoll(void *sst, struct pollfd *fds, int *nfds_io,
state_assert(st,st->state==SITE_RUN);
slog(st,LOG_STATE,"entering state RESOLVE");
st->state=SITE_RESOLVE;
state_assert(st,st->state==SITE_RUN);
slog(st,LOG_STATE,"entering state RESOLVE");
st->state=SITE_RESOLVE;
- st->resolver->request(st->resolver->st,st->address,
- site_resolve_callback,st);
- return True;
+ return st->resolver->request(st->resolver->st,st->address,
+ site_resolve_callback,st);
}
static bool_t enter_new_state(struct site *st, uint32_t next)
}
static bool_t enter_new_state(struct site *st, uint32_t next)