+ Resolver *res= logfndata;
+ int l, newline;
+ char *str;
+
+ l= vasprintf(&str,fmt,al);
+ if (l<0) {
+ posixerr(res->interp,errno,"construct adns log callback string");
+ Tcl_BackgroundError(res->interp);
+ }
+
+ if (l==0) { free(str); return; }
+ if ((newline= l>0 && str[l-1]=='\n')) l--;
+
+ if (!res->errstring_accum) {
+ res->errstring_accum= Tcl_NewStringObj(str,l);
+ Tcl_IncrRefCount(res->errstring_accum);
+ } else {
+ Tcl_AppendToObj(res->errstring_accum,str,l);
+ }
+ free(str);
+
+ if (newline)
+ adnslogfn_flushmessage(res);
+}
+
+static Resolver *default_resolver(Tcl_Interp *ip) {
+ return Tcl_GetAssocData(ip,ASSOC_DEFAULTRES,0);