summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-04-22 20:42:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-04-22 20:48:18 (GMT)
commit7b3078dab5ae53b9de9402c30b44d87277cf2aa9 (patch)
treea442dbff9010da1efd8f83ac88c4c4a98a848216 /Swiften/LinkLocal
parent35abc53f0d9a18a0c509092c7222ca123ed01dfb (diff)
downloadswift-7b3078dab5ae53b9de9402c30b44d87277cf2aa9.zip
swift-7b3078dab5ae53b9de9402c30b44d87277cf2aa9.tar.bz2
Fix AvahiBrowserQuery compilation.
Diffstat (limited to 'Swiften/LinkLocal')
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h12
-rw-r--r--Swiften/LinkLocal/SConscript1
2 files changed, 9 insertions, 4 deletions
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
index cca0475..4b8987f 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
@@ -17,14 +17,15 @@ namespace Swift {
class AvahiBrowseQuery : public DNSSDBrowseQuery, public AvahiQuery {
public:
- AvahiBrowseQuery(boost::shared_ptr<AvahiQuerier> q) : AvahiQuery(q) {
+ AvahiBrowseQuery(boost::shared_ptr<AvahiQuerier> q) : AvahiQuery(q), browser(NULL) {
}
void startBrowsing() {
+ assert(!browser);
std::cout << "Start browsing" << std::endl;
avahi_threaded_poll_lock(querier->getThreadedPoll());
std::cout << "Creating browser" << std::endl;
- AvahiServiceBrowser* browser = avahi_service_browser_new(querier->getClient(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_presence._tcp", NULL, (AvahiLookupFlags) 0, &handleServiceDiscoveredStatic, this);
+ browser = avahi_service_browser_new(querier->getClient(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_presence._tcp", NULL, (AvahiLookupFlags) 0, &handleServiceDiscoveredStatic, this);
if (!browser) {
std::cout << "Error" << std::endl;
MainEventLoop::postEvent(boost::bind(boost::ref(onError)), shared_from_this());
@@ -35,9 +36,8 @@ namespace Swift {
}
void stopBrowsing() {
- assert(browser);
avahi_threaded_poll_lock(querier->getThreadedPoll());
- avahi_server_browser_free(browser);
+ avahi_service_browser_free(browser);
browser = NULL;
avahi_threaded_poll_unlock(querier->getThreadedPoll());
}
@@ -70,5 +70,9 @@ namespace Swift {
break;
}
}
+
+ private:
+ AvahiServiceBrowser* browser;
+
};
}
diff --git a/Swiften/LinkLocal/SConscript b/Swiften/LinkLocal/SConscript
index b929db1..3d4d737 100644
--- a/Swiften/LinkLocal/SConscript
+++ b/Swiften/LinkLocal/SConscript
@@ -28,6 +28,7 @@ if myenv.get("HAVE_BONJOUR", 0) :
"DNSSD/Bonjour/BonjourQuery.cpp",
]
elif myenv.get("HAVE_AVAHI", 0) :
+ myenv.Append(CPPDEFINES = ["HAVE_AVAHI"])
sources += [
"DNSSD/Avahi/AvahiQuerier.cpp",
"DNSSD/Avahi/AvahiQuery.cpp"