Replace all the adns__consistency calls on the return paths from adns
with adns__returning (except in setup.c, whose functions never set up
any queries).
I have separately gone through the public entrypoints in adns.h and
checked that they have the expected adns__consistency calls. So with
this patch, the new imprecation about adns__returning is satisfied.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
struct timeval now) {
adns__consistency(ads,0,cc_entex);
adns__timeouts(ads, 0, tv_io,tvbuf, now);
struct timeval now) {
adns__consistency(ads,0,cc_entex);
adns__timeouts(ads, 0, tv_io,tvbuf, now);
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
}
void adns_processtimeouts(adns_state ads, const struct timeval *now) {
}
void adns_processtimeouts(adns_state ads, const struct timeval *now) {
adns__consistency(ads,0,cc_entex);
adns__must_gettimeofday(ads,&now,&tv_buf);
if (now) adns__timeouts(ads, 1, 0,0, *now);
adns__consistency(ads,0,cc_entex);
adns__must_gettimeofday(ads,&now,&tv_buf);
if (now) adns__timeouts(ads, 1, 0,0, *now);
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
}
/* fd handling functions. These are the top-level of the real work of
}
/* fd handling functions. These are the top-level of the real work of
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
}
void adns_afterselect(adns_state ads, int maxfd, const fd_set *readfds,
}
void adns_afterselect(adns_state ads, int maxfd, const fd_set *readfds,
maxfd,readfds,writefds,exceptfds,
*now, 0);
xit:
maxfd,readfds,writefds,exceptfds,
*now, 0);
xit:
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
}
/* General helpful functions. */
}
/* General helpful functions. */
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
}
int adns_processany(adns_state ads) {
}
int adns_processany(adns_state ads) {
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
adns_afterselect(ads,maxfd,&readfds,&writefds,&exceptfds,0);
}
}
adns_afterselect(ads,maxfd,&readfds,&writefds,&exceptfds,0);
}
}
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
if (!r) adns__autosys(ads,now);
r= adns__internal_check(ads,query_io,answer_r,context_r);
if (!r) adns__autosys(ads,now);
r= adns__internal_check(ads,query_io,answer_r,context_r);
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
void adns__query_fail(adns_query qu, adns_status stat);
void adns__cancel_children(adns_query qu);
void adns__query_fail(adns_query qu, adns_status stat);
void adns__cancel_children(adns_query qu);
+void adns__returning(adns_state ads, adns_query qu);
+/* Must be called before returning from adns any time that we have
+ * progressed (including made, finished or destroyed) queries. */
+
/* From reply.c: */
void adns__procdgram(adns_state ads, const byte *dgram, int len,
/* From reply.c: */
void adns__procdgram(adns_state ads, const byte *dgram, int len,
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
adns__timeouts(ads, 1, 0,0, *now);
adns__fdevents(ads, fds,nfds, 0,0,0,0, *now,0);
}
adns__timeouts(ads, 1, 0,0, *now);
adns__fdevents(ads, fds,nfds, 0,0,0,0, *now,0);
}
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
}
int adns_wait_poll(adns_state ads,
}
int adns_wait_poll(adns_state ads,
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
query_simple(ads,qu, owner,ol, typei,flags, now);
}
adns__autosys(ads,now);
query_simple(ads,qu, owner,ol, typei,flags, now);
}
adns__autosys(ads,now);
- adns__consistency(ads,qu,cc_entex);
+ adns__returning(ads,qu);
return 0;
x_adnsfail:
adns__query_fail(qu,stat);
return 0;
x_adnsfail:
adns__query_fail(qu,stat);
- adns__consistency(ads,qu,cc_entex);
+ adns__returning(ads,qu);
return 0;
x_errno:
r= errno;
assert(r);
return 0;
x_errno:
r= errno;
assert(r);
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
+void adns__returning(adns_state ads, adns_query qu_for_caller) {
+ adns__consistency(ads,qu_for_caller,cc_entex);
+}
+
void adns_cancel(adns_query qu) {
adns_state ads;
void adns_cancel(adns_query qu) {
adns_state ads;
free_query_allocs(qu);
free(qu->answer);
free(qu);
free_query_allocs(qu);
free(qu->answer);
free(qu);
- adns__consistency(ads,0,cc_entex);
+ adns__returning(ads,0);
}
void adns__update_expires(adns_query qu, unsigned long ttl,
}
void adns__update_expires(adns_query qu, unsigned long ttl,