summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BuildTools/SCons/SConstruct2
-rw-r--r--Slimber/CLI/SConscript1
-rw-r--r--Slimber/Qt/SConscript1
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h12
-rw-r--r--Swiften/LinkLocal/SConscript1
5 files changed, 12 insertions, 5 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 72e989e..844654d 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -259,7 +259,7 @@ else :
# Avahi
if conf.CheckCHeader("avahi-client/client.h") and conf.CheckLib("avahi-client") :
env["HAVE_AVAHI"] = True
- env["AVAHI_FLAGS"] = { "LIBS": ["avahi"] }
+ env["AVAHI_FLAGS"] = { "LIBS": ["avahi-client"] }
conf.Finish()
diff --git a/Slimber/CLI/SConscript b/Slimber/CLI/SConscript
index b65843d..87324ad 100644
--- a/Slimber/CLI/SConscript
+++ b/Slimber/CLI/SConscript
@@ -4,5 +4,6 @@ myenv = env.Clone()
myenv.MergeFlags(env["SLIMBER_FLAGS"])
myenv.MergeFlags(env["SWIFTEN_FLAGS"])
myenv.MergeFlags(env["BOOST_FLAGS"])
+myenv.MergeFlags(env["AVAHI_FLAGS"])
myenv.Program("slimber", ["main.cpp"])
diff --git a/Slimber/Qt/SConscript b/Slimber/Qt/SConscript
index c2e203c..9b0a8db 100644
--- a/Slimber/Qt/SConscript
+++ b/Slimber/Qt/SConscript
@@ -10,6 +10,7 @@ myenv.MergeFlags(env["LIBIDN_FLAGS"])
myenv.MergeFlags(env["BOOST_FLAGS"])
myenv.MergeFlags(env.get("LIBXML_FLAGS", ""))
myenv.MergeFlags(env.get("EXPAT_FLAGS", ""))
+myenv.MergeFlags(env.get("AVAHI_FLAGS", ""))
myenv.Tool("qt4", toolpath = ["#/BuildTools/SCons/Tools"])
myenv.Tool("nsis", toolpath = ["#/BuildTools/SCons/Tools"])
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"