summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 17:03:04 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 17:03:04 +0000
commit5a65d2f58804f4067a2f5d7ad27c1cb1645d911a (patch)
tree96ce1fc2a648526c7009c350bba3471e7506c694
parent5b02b8768dd6066e2083987703951baa50c96e62 (diff)
Tidyup dns.cpp
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4639 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/dns.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index 753df7cf8..876044a26 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -110,7 +110,7 @@ class s_connection
}
unsigned char* result_ready(s_header &h, int length);
- int send_requests(const s_header *h, const int l);
+ int send_requests(const s_header *h, const int l, QueryType qt);
};
@@ -171,11 +171,14 @@ inline void dns_empty_header(unsigned char *output, const s_header *header, cons
}
-int s_connection::send_requests(const s_header *h, const int l)
+int s_connection::send_requests(const s_header *h, const int l, QueryType qt)
{
insp_sockaddr addr;
unsigned char payload[sizeof(s_header)];
+ this->_class = 1;
+ this->type = qt;
+
dns_empty_header(payload,h,l);
memset(&addr,0,sizeof(addr));
@@ -323,9 +326,8 @@ int DNS::dns_getip4(const char *name)
s = dns_add_query(&h, id);
if (s == NULL)
return -1;
- s->_class = 1;
- s->type = DNS_QRY_A;
- if (s->send_requests(&h,l) == -1)
+
+ if (s->send_requests(&h,l,DNS_QRY_A) == -1)
return -1;
return id;
@@ -354,9 +356,7 @@ int DNS::dns_getname4(const insp_inaddr *ip)
s = dns_add_query(&h, id);
if (s == NULL)
return -1;
- s->_class = 1;
- s->type = DNS_QRY_PTR;
- if (s->send_requests(&h,l) == -1)
+ if (s->send_requests(&h,l,DNS_QRY_PTR) == -1)
return -1;
return id;