chiark
/
gitweb
/
~mdw
/
adns
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reentrancy: Introduce adns__cancel
[adns]
/
src
/
internal.h
diff --git
a/src/internal.h
b/src/internal.h
index 552db151b7ff495da637c416324c743fd7dd2c21..d53ea5f3a93c40542d1fc06e15904f9710521eda 100644
(file)
--- a/
src/internal.h
+++ b/
src/internal.h
@@
-217,6
+217,12
@@
typedef struct typeinfo {
/* Return the output resource-record element size; if this is null, then
* the rrsz member can be used.
*/
/* Return the output resource-record element size; if this is null, then
* the rrsz member can be used.
*/
+
+ void (*query_send)(adns_query qu, struct timeval now);
+ /* Send the query to nameservers, and hook it into the appropriate queue.
+ * Normal behaviour is to call adns__query_send, but this can be overridden
+ * for special effects.
+ */
} typeinfo;
adns_status adns__ckl_hostname(adns_state ads, adns_queryflags flags,
} typeinfo;
adns_status adns__ckl_hostname(adns_state ads, adns_queryflags flags,
@@
-595,6
+601,7
@@
void adns__query_send(adns_query qu, struct timeval now);
/* From query.c: */
adns_status adns__internal_submit(adns_state ads, adns_query *query_r,
/* From query.c: */
adns_status adns__internal_submit(adns_state ads, adns_query *query_r,
+ adns_query parent,
const typeinfo *typei, adns_rrtype type,
vbuf *qumsg_vb, int id,
adns_queryflags flags, struct timeval now,
const typeinfo *typei, adns_rrtype type,
vbuf *qumsg_vb, int id,
adns_queryflags flags, struct timeval now,
@@
-697,10
+704,15
@@
void adns__reset_preserved(adns_query qu);
* in a datagram and discover that we need to retry the query.
*/
* in a datagram and discover that we need to retry the query.
*/
+void adns__cancel(adns_query qu);
void adns__query_done(adns_query qu);
void adns__query_fail(adns_query qu, adns_status stat);
void adns__cancel_children(adns_query qu);
void adns__query_done(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,
@@
-865,6
+877,7
@@
void adns__autosys(adns_state ads, struct timeval now);
void adns__must_gettimeofday(adns_state ads, const struct timeval **now_io,
struct timeval *tv_buf);
void adns__must_gettimeofday(adns_state ads, const struct timeval **now_io,
struct timeval *tv_buf);
+/* Call with care - might reentrantly cause queries to be completed! */
int adns__pollfds(adns_state ads, struct pollfd pollfds_buf[MAX_POLLFDS]);
void adns__fdevents(adns_state ads,
int adns__pollfds(adns_state ads, struct pollfd pollfds_buf[MAX_POLLFDS]);
void adns__fdevents(adns_state ads,