diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-12-18 18:50:50 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-12-18 18:50:50 (GMT) |
commit | 312a114c7e204cfe4cfe961509ab9b24ccde7860 (patch) | |
tree | 7649aba8b50de49f5259709ee3d34b035d83b33b /Swiften/Network/PlatformDomainNameQuery.h | |
parent | 790dd3e97c6634f6a256f2e072507b9d5f29348b (diff) | |
download | swift-contrib-312a114c7e204cfe4cfe961509ab9b24ccde7860.zip swift-contrib-312a114c7e204cfe4cfe961509ab9b24ccde7860.tar.bz2 |
Move all domain name resolve queries into one thread.
This avoids reentrancy problems on some platform DNS calls.
Resolves: #443
Diffstat (limited to 'Swiften/Network/PlatformDomainNameQuery.h')
-rw-r--r-- | Swiften/Network/PlatformDomainNameQuery.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Swiften/Network/PlatformDomainNameQuery.h b/Swiften/Network/PlatformDomainNameQuery.h new file mode 100644 index 0000000..bbfb1d1 --- /dev/null +++ b/Swiften/Network/PlatformDomainNameQuery.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> + +namespace Swift { + class PlatformDomainNameResolver; + + class PlatformDomainNameQuery { + public: + typedef boost::shared_ptr<PlatformDomainNameQuery> ref; + + PlatformDomainNameQuery(PlatformDomainNameResolver* resolver) : resolver(resolver) {} + virtual ~PlatformDomainNameQuery() {} + + virtual void runBlocking() = 0; + + protected: + PlatformDomainNameResolver* getResolver() { + return resolver; + } + + private: + PlatformDomainNameResolver* resolver; + }; +} |