summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-23 20:16:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-23 20:16:18 +0000
commit61816ef0dd848225e9ec1c21c3c7a3bc03a34da9 (patch)
treee455b9142ba9b6945c15a27ef0a9bf7dd13c7480
parent39ebb06a6ab604d8aa491e8dd218d383cd4968d6 (diff)
Tidyup some duplicated code
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7808 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/dns.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index a714794bf..d297260d5 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -230,25 +230,16 @@ int DNSRequest::SendRequests(const DNSHeader *header, const int length, QueryTyp
return -1;
}
else
+#endif
{
sockaddr_in addr;
memset(&addr,0,sizeof(addr));
memcpy(&addr.sin_addr.s_addr,&dnsobj->myserver4,sizeof(addr.sin_addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(DNS::QUERY_PORT);
- if (sendto(dnsobj->GetFd(), payload, length + 12, 0, (sockaddr *) &addr, sizeof(addr)) != length+12)
+ if (sendto(dnsobj->GetFd(), (const char*)payload, length + 12, 0, (sockaddr *) &addr, sizeof(addr)) != length+12)
return -1;
}
-#else
- sockaddr_in addr;
- memset(&addr,0,sizeof(addr));
- memcpy(&addr.sin_addr.s_addr, &dnsobj->myserver4, sizeof(addr.sin_addr));
- addr.sin_family = AF_INET;
- addr.sin_port = htons(DNS::QUERY_PORT);
- if (sendto(dnsobj->GetFd(), (const char*)payload, length + 12, 0, (sockaddr *) &addr, sizeof(addr)) != length+12)
- return -1;
-#endif
-
return 0;
}