summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/LinkLocalConnector.cpp')
-rw-r--r--Swiften/LinkLocal/LinkLocalConnector.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/LinkLocalConnector.cpp b/Swiften/LinkLocal/LinkLocalConnector.cpp
index 40558d4..326d053 100644
--- a/Swiften/LinkLocal/LinkLocalConnector.cpp
+++ b/Swiften/LinkLocal/LinkLocalConnector.cpp
@@ -20,6 +20,10 @@ LinkLocalConnector::LinkLocalConnector(
connection(connection) {
}
+LinkLocalConnector::~LinkLocalConnector() {
+ assert(!resolveQuery);
+}
+
void LinkLocalConnector::connect() {
resolveQuery = querier->createResolveHostnameQuery(
service.getHostname(),
@@ -31,6 +35,14 @@ void LinkLocalConnector::connect() {
resolveQuery->run();
}
+void LinkLocalConnector::cancel() {
+ if (resolveQuery) {
+ resolveQuery->finish();
+ }
+ resolveQuery.reset();
+ connection->disconnect();
+}
+
void LinkLocalConnector::handleHostnameResolved(const boost::optional<HostAddress>& address) {
if (address) {
resolveQuery->finish();