diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-12-03 22:10:02 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-12-03 22:10:02 (GMT) |
commit | c8802e3bef6b73d349a711b187c72aea0a3dd964 (patch) | |
tree | 09dbb588a363984e70c2aeaaca7b23a5b6cfb497 | |
parent | fc3e50bfb421348c333d6ed4acd79e5241caf120 (diff) | |
download | swift-c8802e3bef6b73d349a711b187c72aea0a3dd964.zip swift-c8802e3bef6b73d349a711b187c72aea0a3dd964.tar.bz2 |
Reinitialize the resolver on every query.
This hopefully fixes the DNS server caching behavior
on network change.
-rw-r--r-- | Swiften/Network/PlatformDomainNameServiceQuery.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Swiften/Network/PlatformDomainNameServiceQuery.cpp b/Swiften/Network/PlatformDomainNameServiceQuery.cpp index 13f5fc8..d6c87dc 100644 --- a/Swiften/Network/PlatformDomainNameServiceQuery.cpp +++ b/Swiften/Network/PlatformDomainNameServiceQuery.cpp @@ -78,12 +78,14 @@ void PlatformDomainNameServiceQuery::doRun() { } currentEntry = currentEntry->pNext; } DnsRecordListFree(responses, DnsFreeRecordList); #else + // Make sure we reinitialize the domain list every time + res_init(); std::cout << "SRV: Querying " << service << std::endl; ByteArray response; response.resize(NS_PACKETSZ); int responseLength = res_query(const_cast<char*>(service.getUTF8Data()), ns_c_in, ns_t_srv, reinterpret_cast<u_char*>(response.getData()), response.getSize()); std::cout << "res_query done " << (responseLength != -1) << std::endl; |