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 7faa2123c4abe4bffec95183ed607c0ed1551536..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,
@@
-672,6
+679,10
@@
void adns__transfer_interim(adns_query from, adns_query to, void *block);
* TTLs get inherited by their parents.
*/
* TTLs get inherited by their parents.
*/
+void adns__free_interim(adns_query qu, void *p);
+/* Forget about a block allocated by adns__alloc_interim.
+ */
+
void *adns__alloc_mine(adns_query qu, size_t sz);
/* Like _interim, but does not record the length for later
* copying into the answer. This just ensures that the memory
void *adns__alloc_mine(adns_query qu, size_t sz);
/* Like _interim, but does not record the length for later
* copying into the answer. This just ensures that the memory
@@
-693,8
+704,14
@@
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__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: */
/* From reply.c: */
@@
-860,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,