summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Johnson <mjj29@qadesh.matthew.ath.cx>2008-11-18 03:20:08 +0000
committerMatthew Johnson <mjj29@qadesh.matthew.ath.cx>2008-11-18 03:20:08 +0000
commitc1d3dcd4f311f0fa621d9c83210f999741755b7a (patch)
tree50d0157a94bb488b42d87cb134719e27e9f876d6
parent5fd501c3a9b4df2740146308fd07ce9a0274ccc9 (diff)
PeerSet works
-rw-r--r--Makefile1
-rw-r--r--changelog7
-rw-r--r--debug.conf5
-rw-r--r--org/freedesktop/dbus/DBusConnection.java14
-rw-r--r--org/freedesktop/dbus/bin/DBusDaemon.java2
-rw-r--r--org/freedesktop/dbus/test/test.java2
6 files changed, 20 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index e28d5b2..4b39270 100644
--- a/Makefile
+++ b/Makefile
@@ -193,6 +193,7 @@ check: libdbus-java-$(VERSION).jar dbus-java-test-$(VERSION).jar testbin/DBusDae
testbin/DBusDaemon --addressfile address --pidfile pid 2> server.log&\
sleep 1; \
export DBUS_SESSION_BUS_ADDRESS=$$(cat address) ;\
+ dbus-monitor >> monitor.log &\
if $(MAKE) DBUS_JAVA_FLOATS=true DEBUG=$(DEBUG) testrun 2>&1 | tee client.log; then export PASS=true; fi ; \
kill $$(cat pid) ; \
if [ "$$PASS" = "true" ]; then exit 0; else exit 1; fi )
diff --git a/changelog b/changelog
index bc5a0e7..7b9554e 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,10 @@
+Version 2.6:
+
+ * Add DBusConnection.releaseBusName API
+ * Add DBusConnection.PeerSet for tracking peer lifetimes
+ * Fix bug where DBusDaemon never sends NameOwnerChanged/NameLost
+ signals
+
Version 2.5.1:
* Fix for possible NPex in DBusDaemon
diff --git a/debug.conf b/debug.conf
index 5da0a4a..ef244b6 100644
--- a/debug.conf
+++ b/debug.conf
@@ -1,14 +1,15 @@
org.freedesktop.dbus.MessageReader = ERR
org.freedesktop.dbus.MessageWriter = ERR
-org.freedesktop.dbus.Message = DEBUG
+org.freedesktop.dbus.Message = ERR
org.freedesktop.dbus.MethodCall = ERR
org.freedesktop.dbus.MethodTuple = ERR
-org.freedesktop.dbus.AbstractConnection = INFO
+org.freedesktop.dbus.AbstractConnection = ERR
org.freedesktop.dbus.AbstractConnection$FallbackContainer = ERR
org.freedesktop.dbus.AbstractConnection$_thread = ERR
org.freedesktop.dbus.AbstractConnection$_sender = ERR
org.freedesktop.dbus.DirectConnection = ERR
org.freedesktop.dbus.DBusConnection = ERR
+org.freedesktop.dbus.DBusConnection$PeerSet = DEBUG
org.freedesktop.dbus.AbstractConnection$1 = ERR
org.freedesktop.dbus.DBusSignal = ERR
org.freedesktop.dbus.EfficientQueue = ERR
diff --git a/org/freedesktop/dbus/DBusConnection.java b/org/freedesktop/dbus/DBusConnection.java
index 058a033..43a5b04 100644
--- a/org/freedesktop/dbus/DBusConnection.java
+++ b/org/freedesktop/dbus/DBusConnection.java
@@ -63,13 +63,15 @@ public class DBusConnection extends AbstractConnection
}
public void handle(DBus.NameOwnerChanged noc)
{
+ if (Debug.debug)
+ Debug.print(Debug.DEBUG, "Received NameOwnerChanged("+noc.name+","+noc.old_owner+","+noc.new_owner+")");
if ("".equals(noc.new_owner) && addresses.contains(noc.name))
- synchronized (addresses) {
- addresses.remove(noc.name);
- }
+ remove(noc.name);
}
public boolean add(String address)
{
+ if (Debug.debug)
+ Debug.print(Debug.DEBUG, "Adding "+address);
synchronized (addresses) {
return addresses.add(address);
}
@@ -114,6 +116,8 @@ public class DBusConnection extends AbstractConnection
}
public boolean remove(Object o)
{
+ if (Debug.debug)
+ Debug.print(Debug.DEBUG, "Removing "+o);
synchronized(addresses) {
return addresses.remove(o);
}
@@ -735,8 +739,4 @@ public class DBusConnection extends AbstractConnection
}
}
}
- public PeerSet getPeerSet()
- {
- return new PeerSet();
- }
}
diff --git a/org/freedesktop/dbus/bin/DBusDaemon.java b/org/freedesktop/dbus/bin/DBusDaemon.java
index bedaff3..fb75241 100644
--- a/org/freedesktop/dbus/bin/DBusDaemon.java
+++ b/org/freedesktop/dbus/bin/DBusDaemon.java
@@ -240,7 +240,7 @@ public class DBusDaemon extends Thread
}
int rv;
- if (exists) {
+ if (!exists) {
rv = DBus.DBUS_RELEASE_NAME_REPLY_NON_EXISTANT;
} else {
if (Debug.debug) Debug.print(Debug.WARN, "Client "+c.unique+" acquired name "+name);
diff --git a/org/freedesktop/dbus/test/test.java b/org/freedesktop/dbus/test/test.java
index a4b1ae4..5333723 100644
--- a/org/freedesktop/dbus/test/test.java
+++ b/org/freedesktop/dbus/test/test.java
@@ -774,7 +774,7 @@ public class test
serverconn.sendSignal(new TestSignalInterface.TestObjectSignal("/foo/bar/Wibble", tclass));
// setup bus name set
- Set<String> peers = serverconn.getPeerSet();
+ Set<String> peers = serverconn.new PeerSet();
peers.add("org.freedesktop.DBus");
clientconn.requestBusName("test.testclient");
peers.add("test.testclient");