Commit cb53f9e2 authored by nanahira's avatar nanahira

fix windows build

parent d179c5b2
......@@ -4379,8 +4379,8 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) {
DNS_STATUS status = DnsQuery_UTF8(hostname, DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, &ret, NULL);
if(status != 0)
return false;
BufferIO::EncodeUTF8(ret->Data.SRV.pNameTarget, resolved);
result->port = ntohs(ret->Data.SRV.wPort);
memcpy(resolved, ret->Data.SRV.pNameTarget, 100);
result->port = ret->Data.SRV.wPort;
DnsRecordListFree(ret, DnsFreeRecordListDeep);
#else
struct __res_state res;
......@@ -4401,9 +4401,8 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) {
// priority = ns_get16(ns_rr_rdata(rr));
// weight = ns_get16(ns_rr_rdata(rr) + NS_INT16SZ);
result->port = ns_get16(ns_rr_rdata(rr) + 2 * NS_INT16SZ);
result->port = ns_get16(ns_rr_rdata(rr) + 2 * NS_INT16SZ);
char resolved[100];
// decompress domain name
if (dn_expand(ns_msg_base(nsMsg), ns_msg_end(nsMsg), ns_rr_rdata(rr) + 3 * NS_INT16SZ, resolved, sizeof(resolved)) < 0)
continue;
......
......@@ -20,7 +20,7 @@ namespace ygo {
class HostResult {
public:
unsigned int host;
unsigned int port;
unsigned short port;
bool isValid() {
return host > 0 && port > 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment