Commit cb53f9e2 authored by nanahira's avatar nanahira

fix windows build

parent d179c5b2
...@@ -4379,8 +4379,8 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) { ...@@ -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); DNS_STATUS status = DnsQuery_UTF8(hostname, DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, &ret, NULL);
if(status != 0) if(status != 0)
return false; return false;
BufferIO::EncodeUTF8(ret->Data.SRV.pNameTarget, resolved); memcpy(resolved, ret->Data.SRV.pNameTarget, 100);
result->port = ntohs(ret->Data.SRV.wPort); result->port = ret->Data.SRV.wPort;
DnsRecordListFree(ret, DnsFreeRecordListDeep); DnsRecordListFree(ret, DnsFreeRecordListDeep);
#else #else
struct __res_state res; struct __res_state res;
...@@ -4403,7 +4403,6 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) { ...@@ -4403,7 +4403,6 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) {
// weight = ns_get16(ns_rr_rdata(rr) + NS_INT16SZ); // 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 // 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) if (dn_expand(ns_msg_base(nsMsg), ns_msg_end(nsMsg), ns_rr_rdata(rr) + 3 * NS_INT16SZ, resolved, sizeof(resolved)) < 0)
continue; continue;
......
...@@ -20,7 +20,7 @@ namespace ygo { ...@@ -20,7 +20,7 @@ namespace ygo {
class HostResult { class HostResult {
public: public:
unsigned int host; unsigned int host;
unsigned int port; unsigned short port;
bool isValid() { bool isValid() {
return host > 0 && port > 0; 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