chiark
/
gitweb
/
~ian
/
chiark-tcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changelog: finalise 1.3.5
[chiark-tcl.git]
/
adns
/
adns.c
diff --git
a/adns/adns.c
b/adns/adns.c
index a21de019793630c466524fbcce689e4f22d4fc03..d0ee2955b94e09e26c36acde087faf81212173fd 100644
(file)
--- a/
adns/adns.c
+++ b/
adns/adns.c
@@
-60,7
+60,7
@@
/*
* adns.c - adns binding for Tcl
/*
* adns.c - adns binding for Tcl
- * Copyright 2006 Ian Jackson
+ * Copyright 2006
-2012
Ian Jackson
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@
-73,9
+73,7
@@
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#define _GNU_SOURCE
*/
#define _GNU_SOURCE
@@
-198,6
+196,14
@@
struct Resolver {
Tcl_Obj *errstring_accum;
};
Tcl_Obj *errstring_accum;
};
+struct Query {
+ int ix; /* first! */
+ Resolver *res;
+ adns_query aqu;
+ ScriptToInvoke on_yes, on_no, on_fail;
+ Tcl_Obj *xargs;
+};
+
/* The default resolver is recorded using Tcl_SetAssocData with key
* ASSOC_DEFAULTRES to record the Resolver*. If it was explicitly
* created with `adns new-resolver' then ix will be >=0, and the
/* The default resolver is recorded using Tcl_SetAssocData with key
* ASSOC_DEFAULTRES to record the Resolver*. If it was explicitly
* created with `adns new-resolver' then ix will be >=0, and the
@@
-284,6
+290,7
@@
static Resolver *default_resolver(Tcl_Interp *ip) {
static void destroy_resolver(Tcl_Interp *ip, Resolver *res) {
void *query_v;
static void destroy_resolver(Tcl_Interp *ip, Resolver *res) {
void *query_v;
+ Query *query;
int logstring_len;
char *rstr;
adns_query aqu;
int logstring_len;
char *rstr;
adns_query aqu;
@@
-305,8
+312,9
@@
static void destroy_resolver(Tcl_Interp *ip, Resolver *res) {
adns_forallqueries_begin(res->ads);
aqu= adns_forallqueries_next(res->ads, &query_v);
if (!aqu) break;
adns_forallqueries_begin(res->ads);
aqu= adns_forallqueries_next(res->ads, &query_v);
if (!aqu) break;
- assert(query_v->aqu == aqu);
- query_v->aqu= 0; /* avoid disrupting the adns query list */
+ query= query_v;
+ assert(query->aqu == aqu);
+ query->aqu= 0; /* avoid disrupting the adns query list */
asynch_query_dispose(ip, query_v);
}
adns_finish(res->ads);
asynch_query_dispose(ip, query_v);
}
adns_finish(res->ads);
@@
-486,7
+494,7
@@
static int query_submit(Tcl_Interp *ip,
if (op.reverseany || (op.sflags & oisf_reverse)) {
const int *af;
if (op.reverseany || (op.sflags & oisf_reverse)) {
const int *af;
- for (af=aftry; af < af + sizeof(af
)/sizeof(*af
); af++) {
+ for (af=aftry; af < af + sizeof(af
try)/sizeof(*aftry
); af++) {
memset(&sa,0,sizeof(sa));
sa.sa_family= *af;
r= inet_pton(*af,domain,&sa);
memset(&sa,0,sizeof(sa));
sa.sa_family= *af;
r= inet_pton(*af,domain,&sa);
@@
-616,14
+624,6
@@
int cht_do_adns_synch(ClientData cd, Tcl_Interp *ip,
/*---------- asynchronous query handling ----------*/
/*---------- asynchronous query handling ----------*/
-struct Query {
- int ix; /* first! */
- Resolver *res;
- adns_query aqu;
- ScriptToInvoke on_yes, on_no, on_fail;
- Tcl_Obj *xargs;
-};
-
static void asynch_check_now(Resolver *res);
static void asynch_timerhandler(void *res_v) {
static void asynch_check_now(Resolver *res);
static void asynch_timerhandler(void *res_v) {