/*
- * $Id: rfc1035.h,v 1.14 2005/05/10 10:09:31 hno Exp $
+ * $Id: rfc1035.h,v 1.15 2005/05/10 10:39:56 hno Exp $
*
* AUTHOR: Duane Wessels
*
char *buf,
size_t sz,
unsigned short qid,
- rfc1035_query *query);
+ rfc1035_query * query);
SQUIDCEXTERN ssize_t rfc1035BuildPTRQuery(const struct IN_ADDR,
char *buf,
size_t sz,
unsigned short qid,
- rfc1035_query *query);
+ rfc1035_query * query);
SQUIDCEXTERN void rfc1035SetQueryID(char *, unsigned short qid);
SQUIDCEXTERN int rfc1035MessageUnpack(const char *buf,
size_t sz,
/*
- * $Id: dns_internal.cc,v 1.74 2005/05/10 10:09:32 hno Exp $
+ * $Id: dns_internal.cc,v 1.75 2005/05/10 10:39:56 hno Exp $
*
* DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c
* AUTHOR: Duane Wessels
}
}
-/* FIXME: We should also verify that the response is to the correct query to eleminate overlaps */
static void
idnsGrokReply(const char *buf, size_t sz)
{
return;
}
- /* FIXME: We should also verify the query to match ours */
if (rfc1035QueryCompare(&q->query, message->query) != 0) {
debug(78, 3) ("idnsGrokReply: Query mismatch (%s != %s)\n", q->query.name, message->query->name);
rfc1035MessageDestroy(message);
q->sz = rfc1035BuildAQuery(name, q->buf, sizeof(q->buf), q->id, &q->query);
+ if (q->sz < 0) {
+ /* problem with query data -- query not sent */
+ callback(data, NULL, 0, "Internal error");
+ memFree(q, MEM_IDNS_QUERY);
+ return;
+ }
+
debug(78, 3) ("idnsALookup: buf is %d bytes for %s, id = %#hx\n",
(int) q->sz, name, q->id);
q->sz = rfc1035BuildPTRQuery(addr, q->buf, sizeof(q->buf), q->id, &q->query);
+ if (q->sz < 0)
+ {
+ /* problem with query data -- query not sent */
+ callback(data, NULL, 0, "Internal error");
+ memFree(q, MEM_IDNS_QUERY);
+ return;
+ }
+
debug(78, 3) ("idnsPTRLookup: buf is %d bytes for %s, id = %#hx\n",
(int) q->sz, ip, q->id);