chiark
/
gitweb
/
~mdw
/
adns
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
82a3a6b
)
Search list seems to work
author
ian
<ian>
Sat, 17 Apr 1999 14:20:45 +0000
(14:20 +0000)
committer
ian
<ian>
Sat, 17 Apr 1999 14:20:45 +0000
(14:20 +0000)
src/adns.h
patch
|
blob
|
blame
|
history
src/query.c
patch
|
blob
|
blame
|
history
diff --git
a/src/adns.h
b/src/adns.h
index 5b25e66b1f3fd5447343cbf76ff7b82d39d22c94..9b3d11013883533e5393ec9c5f498710b9c1ac9c 100644
(file)
--- a/
src/adns.h
+++ b/
src/adns.h
@@
-19,7
+19,7
@@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id: adns.h,v 1.4
5 1999/04/11 21:01:49
ian Exp $
+ * $Id: adns.h,v 1.4
6 1999/04/17 14:20:45
ian Exp $
*/
#ifndef ADNS_H_INCLUDED
*/
#ifndef ADNS_H_INCLUDED
@@
-48,6
+48,7
@@
typedef enum {
typedef enum {
adns_qf_search= 0x000001, /* use the searchlist */
adns_qf_usevc= 0x000002, /* use a virtual circuit (TCP connection) */
typedef enum {
adns_qf_search= 0x000001, /* use the searchlist */
adns_qf_usevc= 0x000002, /* use a virtual circuit (TCP connection) */
+ adns_qf_owner= 0x000004, /* fill in the owner field in the answer fixme:do */
adns_qf_quoteok_query= 0x000010, /* allow quote-requiring chars in query domain */
adns_qf_quoteok_cname= 0x000020, /* allow ... in CNAME we go via */
adns_qf_quoteok_anshost= 0x000040, /* allow ... in answers expected to be hostnames */
adns_qf_quoteok_query= 0x000010, /* allow quote-requiring chars in query domain */
adns_qf_quoteok_cname= 0x000020, /* allow ... in CNAME we go via */
adns_qf_quoteok_anshost= 0x000040, /* allow ... in answers expected to be hostnames */
@@
-195,6
+196,7
@@
typedef struct {
typedef struct {
adns_status status;
char *cname; /* always NULL if query was for CNAME records */
typedef struct {
adns_status status;
char *cname; /* always NULL if query was for CNAME records */
+ char *owner; /* often NULL, depending on query flags */
adns_rrtype type; /* guaranteed to be same as in query */
time_t expires; /* expiry time, defined only if _s_ok, nxdomain or nodata. NOT TTL! */
int nrrs, rrsz;
adns_rrtype type; /* guaranteed to be same as in query */
time_t expires; /* expiry time, defined only if _s_ok, nxdomain or nodata. NOT TTL! */
int nrrs, rrsz;
diff --git
a/src/query.c
b/src/query.c
index 81c04cb2b1e44abba0588987e0b578605930d8dc..c420fcf26716a77a39d515588c2bfca3fd2eac23 100644
(file)
--- a/
src/query.c
+++ b/
src/query.c
@@
-156,12
+156,11
@@
void adns__search_next(adns_state ads, adns_query qu, struct timeval now) {
}
}
}
}
+ qu->search_vb.used= qu->search_origlen;
if (nextentry) {
if (!adns__vbuf_append(&qu->search_vb,".",1) ||
!adns__vbuf_appendstr(&qu->search_vb,nextentry)) {
stat= adns_s_nomemory; goto x_fail;
if (nextentry) {
if (!adns__vbuf_append(&qu->search_vb,".",1) ||
!adns__vbuf_appendstr(&qu->search_vb,nextentry)) {
stat= adns_s_nomemory; goto x_fail;
- } else {
- qu->search_vb.used= qu->search_origlen;
}
}
}
}
@@
-198,6
+197,8
@@
int adns_submit(adns_state ads,
qu->ctx.callback= 0;
memset(&qu->ctx.info,0,sizeof(qu->ctx.info));
qu->ctx.callback= 0;
memset(&qu->ctx.info,0,sizeof(qu->ctx.info));
+ *query_r= qu;
+
ol= strlen(owner);
if (!ol) { stat= adns_s_querydomaininvalid; goto x_adnsfail; }
if (ol>DNS_MAXDOMAIN+1) { stat= adns_s_querydomaintoolong; goto x_adnsfail; }
ol= strlen(owner);
if (!ol) { stat= adns_s_querydomaininvalid; goto x_adnsfail; }
if (ol>DNS_MAXDOMAIN+1) { stat= adns_s_querydomaintoolong; goto x_adnsfail; }
@@
-210,14
+211,11
@@
int adns_submit(adns_state ads,
for (ndots=0, p=owner; (p= strchr(p,'.')); p++, ndots++);
qu->search_doneabs= (ndots >= ads->searchndots) ? -1 : 0;
for (ndots=0, p=owner; (p= strchr(p,'.')); p++, ndots++);
qu->search_doneabs= (ndots >= ads->searchndots) ? -1 : 0;
-
qu->search_origlen= ol;
qu->search_origlen= ol;
-
adns__search_next(ads,qu,now);
adns__search_next(ads,qu,now);
- return 0;
+ } else {
+ query_simple(ads,qu, owner,ol, typei,flags, now);
}
}
-
- query_simple(ads,qu, owner,ol, typei,flags, now);
return 0;
x_adnsfail:
return 0;
x_adnsfail: