Hello community,
here is the log from the commit of package telepathy-glib for openSUSE:Factory
checked in at Mon Jan 10 11:04:30 CET 2011.
--------
--- telepathy-glib/telepathy-glib.changes 2010-12-14 16:44:59.000000000 +0100
+++ /mounts/work_src_done/STABLE/telepathy-glib/telepathy-glib.changes 2010-12-21 10:23:22.000000000 +0100
@@ -1,0 +2,13 @@
+Tue Dec 21 10:21:13 CET 2010 - vuntz@opensuse.org
+
+- Update to version 0.12.7:
+ + Fixes:
+ - tp_account_manager_ensure_account() no longer criticals if
+ you pass it a malformed account path.
+ - TpBaseClient will now return (an error) from ObserveChannels
+ if an invalid connection path is passed to it by the Channel
+ Dispatcher.
+ - fdo#32391: correctly deal with removing name owner watches
+ during dispatch of their callbacks
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
telepathy-glib-0.12.6.tar.bz2
New:
----
telepathy-glib-0.12.7.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ telepathy-glib.spec ++++++
--- /var/tmp/diff_new_pack.uR4JX9/_old 2011-01-10 11:02:14.000000000 +0100
+++ /var/tmp/diff_new_pack.uR4JX9/_new 2011-01-10 11:02:14.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package telepathy-glib (Version 0.12.6)
+# spec file for package telepathy-glib (Version 0.12.7)
#
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
Name: telepathy-glib
-Version: 0.12.6
+Version: 0.12.7
Release: 1
License: LGPLv2.1
Summary: Libraries for adding telepathy support to applications that use glib
++++++ telepathy-glib-0.12.6.tar.bz2 -> telepathy-glib-0.12.7.tar.bz2 ++++++
++++ 1649 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/ChangeLog new/telepathy-glib-0.12.7/ChangeLog
--- old/telepathy-glib-0.12.6/ChangeLog 2010-12-10 17:48:35.000000000 +0100
+++ new/telepathy-glib-0.12.7/ChangeLog 2010-12-20 16:17:26.000000000 +0100
@@ -1,3 +1,154 @@
+commit c07d90220372a94a1f64e630165e5569cfeff38e
+Author: Will Thompson
+Date: 2010-12-20 15:11:48 +0000
+
+ Version 0.12.7
+
+commit 78f683f9817d627b3f2404ad125961274fb5b8ff
+Author: Simon McVittie
+Date: 2010-12-16 19:02:10 +0000
+
+ NEWS
+
+commit 6fd6364e9d0e6cb6dfd9cfa8897905561b39875b
+Merge: 8ae5881 13638f7
+Author: Simon McVittie
+Date: 2010-12-16 18:57:55 +0000
+
+ Merge branch '012-noc-fixes' into telepathy-glib-0.12
+
+ Reviewed-by: Will Thompson
+ Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32391
+
+commit 13638f7d1bd48d4e2fde4bab6fa77563d2604ed6
+Author: Simon McVittie
+Date: 2010-12-16 18:54:29 +0000
+
+ fix a typo in the test, and make even more assertions
+
+commit 95cd35028fec0239cfe05ece3f571d055ff6e501
+Author: Simon McVittie
+Date: 2010-12-16 18:42:08 +0000
+
+ tests/dbus/dbus: cancel_watch_during_dispatch: assert that user_data is freed
+
+commit 53d392c2d3d0b18228a33fecb002bdeb11ee61ed
+Author: Simon McVittie
+Date: 2010-12-16 18:41:42 +0000
+
+ Fix iteration over arrays of name-owner watches
+
+ Also document why we're iterating backwards.
+
+ In tp_dbus_daemon_maybe_free_name_owner_watch, the flawed
+ reverse-iteration was a bug: we'd skip over the element before a removed
+ entry, which might mean not freeing it.
+
+ In tp_dbus_daemon_cancel_name_owner_watch, it was done correctly (because
+ there were no deletions), but it did hurt clarity.
+
+commit b5f91061714d1471fa15a03ea8f1d5179f9693c4
+Author: Will Thompson
+Date: 2010-12-14 13:01:30 +0000
+
+ Add a test case for removing name watches during dispatch
+
+ This test case failed before the previous patch.
+
+commit e19b12900f0c1c2eab01f1b28ca9752f66852d5a
+Author: Simon McVittie
+Date: 2010-12-16 17:16:39 +0000
+
+ Don't remove NameOwnerChanged callbacks while invoking them
+
+commit 99830254d26a7194b5d0f6cf9f0def35714b33f9
+Author: Will Thompson
+Date: 2010-12-14 01:10:06 +0000
+
+ Simplify dispatching NameOwnerChanged signals.
+
+ Previously there was this weird model where TpDBusDaemon had a dict
+ mapping bus names being watched to a watch struct. The watch struct had
+ a callback and some user data. When the library user first added a watch
+ for a name, their callback would be shoved into a new struct that was
+ put into the dict, and all was bright. But when a second call to
+ _watch_name_owner() came along … a GArray of "sub watches" would be
+ created, the old callback copied into it and the new callback added to
+ it, and then the original struct's callback would be replaced by an
+ callback that iterates the subwatches.
+
+ I couldn't see any good reason not to always have a list of callbacks,
+ so deleted that code. Now all watches have a list of callbacks, and it's
+ a bit clearer.
+
+ Making this change found a nasty bug where, if one callback removes its
+ own watch, subsequent callbacks may not be called for this signal. Test
+ case and fix to follow.
+
+commit 4f00eb1dcdaeb5637aa517d5263c9f6481333fe4
+Author: Will Thompson
+Date: 2010-12-14 02:22:19 +0000
+
+ Make 'dbus' test use GTest.
+
+commit a83bff2591540aee8a17bee920ed089a4b559009
+Author: Will Thompson
+Date: 2010-12-14 02:01:19 +0000
+
+ Modernize 'dbus' test a bit.
+
+ This excellently named test tests TpDBusDaemon and a bunch of utility
+ functions which should be in libdbus, but aren't.
+
+ MYASSERT brings me out in a rash. MYASSERT (foo, "") actually causes
+ boils to sprout fully formed from my neck.
+
+commit 8ae5881117202aa7c1ebccef0f8ab74271dea364
+Author: Will Thompson
+Date: 2010-12-13 10:57:14 +0000
+
+ NEWS for minor fixes from fd.o#32184
+
+commit ef2a060342bc3780870eba118261654596cc694c
+Merge: 7570666 1841a32
+Author: Will Thompson
+Date: 2010-12-13 10:54:49 +0000
+
+ Merge branch 'fd.o-32184-trivial-fixes' into telepathy-glib-0.12
+
+ Reviewed-by: Simon McVittie
+
+commit 1841a32749f2c6979840fe72694feb2547fd99ec
+Author: Will Thompson
+Date: 2010-12-07 16:14:10 +0000
+
+ AM.ensure_account(): Don't critical on invalid paths
+
+ Currently, tp_account_manager_ensure_account() g_return_val_if_fail()s
+ if tp_account_new() returns NULL, but doesn't actually check the path
+ that the user passes in, so the latter can quite legitimately return
+ NULL. So, let's return NULL cleanly instead.
+
+commit 1e4a7475948a7b6d73fcb1654c1eb0d6498cc95a
+Author: Will Thompson
+Date: 2010-12-07 16:04:01 +0000
+
+ BaseClient.ObserveChannels: handle broken connection paths
+
+ Previously, if someone passed an invalid connection path to
+ ObserveChannels, tp-glib wouldn't pass the call up to the application,
+ but nor would it return an error from the method.
+
+ This manifested itself in the logger failing to return (or indeed log
+ messages) when I hit
+ https://bugs.freedesktop.org/show_bug.cgi?id=32184.
+
+commit 7570666e34f4f051f36926c8fb3b9a6d998e5d82
+Author: Simon McVittie
+Date: 2010-12-10 16:55:02 +0000
+
+ Nano version
+
commit 6e294bf5edaa105f6c59002c4537bd5b90c65c10
Author: Simon McVittie
Date: 2010-12-10 16:47:53 +0000
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/configure.ac new/telepathy-glib-0.12.7/configure.ac
--- old/telepathy-glib-0.12.6/configure.ac 2010-12-10 17:24:49.000000000 +0100
+++ new/telepathy-glib-0.12.7/configure.ac 2010-12-20 16:10:43.000000000 +0100
@@ -11,7 +11,7 @@
m4_define([tp_glib_major_version], [0])
m4_define([tp_glib_minor_version], [12])
-m4_define([tp_glib_micro_version], [6])
+m4_define([tp_glib_micro_version], [7])
m4_define([tp_glib_nano_version], [0])
# If library source has changed since last release, increment revision
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/html/index.html new/telepathy-glib-0.12.7/docs/reference/html/index.html
--- old/telepathy-glib-0.12.6/docs/reference/html/index.html 2010-12-10 17:48:35.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/html/index.html 2010-12-20 16:17:26.000000000 +0100
@@ -15,7 +15,7 @@
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">telepathy-glib API Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">
- for telepathy-glib version 0.12.6
+ for telepathy-glib version 0.12.7
.
The latest development version of this documentation can be found here:
<a class="ulink" href="http://telepathy.freedesktop.org/doc/telepathy-glib/" target="_top">online copy of the telepathy-glib API Reference Manual</a>.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-account-manager.html new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-account-manager.html
--- old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-account-manager.html 2010-12-10 17:48:35.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-account-manager.html 2010-12-20 16:17:25.000000000 +0100
@@ -401,7 +401,8 @@
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new <a class="link" href="telepathy-glib-account.html#TpAccount"><span class="type">TpAccount</span></a> at <em class="parameter"><code>path</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
+<td> a new <a class="link" href="telepathy-glib-account.html#TpAccount"><span class="type">TpAccount</span></a> at <em class="parameter"><code>path</code></em>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>path</code></em> is
+ not a valid account path. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-asv.html new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-asv.html
--- old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-asv.html 2010-12-10 17:48:35.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-asv.html 2010-12-20 16:17:25.000000000 +0100
@@ -235,7 +235,7 @@
<p>
</p>
<div class="example">
-<a name="id648721"></a><p class="title"><b>Example 1. Using <a class="link" href="telepathy-glib-asv.html#tp-asv-new" title="tp_asv_new ()"><code class="function">tp_asv_new()</code></a></b></p>
+<a name="id437240"></a><p class="title"><b>Example 1. Using <a class="link" href="telepathy-glib-asv.html#tp-asv-new" title="tp_asv_new ()"><code class="function">tp_asv_new()</code></a></b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-channel-dispatch-operation.html new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-channel-dispatch-operation.html
--- old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-channel-dispatch-operation.html 2010-12-10 17:48:35.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-channel-dispatch-operation.html 2010-12-20 16:17:26.000000000 +0100
@@ -1169,12 +1169,12 @@
<p>
If an X server timestamp for the user action causing this method call is
available, <em class="parameter"><code>user_action_time</code></em> should be this timestamp (for instance, the
-result of <a href="http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#gdk-event-get-time"><code class="function">gdk_event_get_time()</code></a> if it is not <a href="http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>). Otherwise, it
+result of <a href="/usr/share/gtk-doc/html/gdk/gdk-Events.html#gdk-event-get-time"><code class="function">gdk_event_get_time()</code></a> if it is not <a href="/usr/share/gtk-doc/html/gdk/gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>). Otherwise, it
may be <a class="link" href="telepathy-glib-defs.html#TP-USER-ACTION-TIME-NOT-USER-ACTION:CAPS" title="TP_USER_ACTION_TIME_NOT_USER_ACTION"><code class="literal">TP_USER_ACTION_TIME_NOT_USER_ACTION</code></a> to behave as if there was no
user action or it happened a long time ago, or
<a class="link" href="telepathy-glib-defs.html#TP-USER-ACTION-TIME-CURRENT-TIME:CAPS" title="TP_USER_ACTION_TIME_CURRENT_TIME"><code class="literal">TP_USER_ACTION_TIME_CURRENT_TIME</code></a> to have the Handler behave as though the
user action had just happened (resembling, but not numerically equal to,
-<a href="http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>).
+<a href="/usr/share/gtk-doc/html/gdk/gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>).
</p>
<p>
This method has been introduced in telepathy-mission-control 5.5.0.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-defs.html new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-defs.html
--- old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-defs.html 2010-12-10 17:48:35.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-defs.html 2010-12-20 16:17:26.000000000 +0100
@@ -199,7 +199,7 @@
The "user action time" used by methods like
<a class="link" href="telepathy-glib-account-channel-request.html#tp-account-channel-request-new" title="tp_account_channel_request_new ()"><code class="function">tp_account_channel_request_new()</code></a> to represent channel requests that should
be treated as though they happened at the current time. This is the same
-concept as <a href="http://library.gnome.org/devel/gdk/unstable/gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a> in Gdk (but note that the numerical value used
+concept as <a href="/usr/share/gtk-doc/html/gdk/gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a> in Gdk (but note that the numerical value used
in Telepathy is not the same).
</p>
<p>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-TpPresenceMixin.html new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-TpPresenceMixin.html
--- old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-TpPresenceMixin.html 2010-12-10 17:48:35.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-TpPresenceMixin.html 2010-12-20 16:17:25.000000000 +0100
@@ -106,7 +106,7 @@
</p>
<div class="section" title="Implementing SimplePresence">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id1137537"></a>Implementing SimplePresence</h2></div></div></div>
+<a name="id926042"></a>Implementing SimplePresence</h2></div></div></div>
<p>
Since 0.7.13 this mixin supports the entire SimplePresence interface.
You can implement <a class="link" href="telepathy-glib-svc-connection.html#TpSvcConnectionInterfaceSimplePresence"><span class="type">TpSvcConnectionInterfaceSimplePresence</span></a> as follows:
@@ -133,7 +133,7 @@
</p>
<div class="section" title="Implementing old-style Presence">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id1137646"></a>Implementing old-style Presence</h2></div></div></div>
+<a name="id926150"></a>Implementing old-style Presence</h2></div></div></div>
<p>
This mixin also supports a large subset of the deprecated Presence
interface. It does not support protocols where it is possible to set
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-util.html new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-util.html
--- old/telepathy-glib-0.12.6/docs/reference/html/telepathy-glib-util.html 2010-12-10 17:48:35.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/html/telepathy-glib-util.html 2010-12-20 16:17:26.000000000 +0100
@@ -1150,7 +1150,7 @@
<p>
</p>
<div class="example">
-<a name="id1201288"></a><p class="title"><b>Example 2. using tp_value_array_build</b></p>
+<a name="id989835"></a><p class="title"><b>Example 2. using tp_value_array_build</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
@@ -1216,7 +1216,7 @@
<p>
</p>
<div class="example">
-<a name="id1201467"></a><p class="title"><b>Example 3. using tp_value_array_unpack</b></p>
+<a name="id990014"></a><p class="title"><b>Example 3. using tp_value_array_unpack</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
@@ -1619,7 +1619,7 @@
<p>
Interpret a Telepathy user action time to decide whether a Handler should
attempt to gain focus. If <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned, it would be appropriate to
-call <a href="http://library.gnome.org/devel/gtk/unstable/GtkWindow.html#gtk-window-present-with-time"><code class="function">gtk_window_present_with_time()</code></a> using <em class="parameter"><code>x11_time</code></em> as input, for instance.
+call <a href="/usr/share/gtk-doc/html/gtk/GtkWindow.html#gtk-window-present-with-time"><code class="function">gtk_window_present_with_time()</code></a> using <em class="parameter"><code>x11_time</code></em> as input, for instance.
</p>
<p>
<em class="parameter"><code>x11_time</code></em> is used to return a timestamp in the right format for X11,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/tmpl/client-message.sgml new/telepathy-glib-0.12.7/docs/reference/tmpl/client-message.sgml
--- old/telepathy-glib-0.12.6/docs/reference/tmpl/client-message.sgml 2010-12-10 17:48:34.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/tmpl/client-message.sgml 2010-12-20 16:17:25.000000000 +0100
@@ -9,11 +9,13 @@
</para>
+
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
+
<!-- ##### SECTION Stability_Level ##### -->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/tmpl/cm-message.sgml new/telepathy-glib-0.12.7/docs/reference/tmpl/cm-message.sgml
--- old/telepathy-glib-0.12.6/docs/reference/tmpl/cm-message.sgml 2010-12-10 17:48:34.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/tmpl/cm-message.sgml 2010-12-20 16:17:25.000000000 +0100
@@ -9,11 +9,13 @@
</para>
+
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
+
<!-- ##### SECTION Stability_Level ##### -->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/tmpl/intset.sgml new/telepathy-glib-0.12.7/docs/reference/tmpl/intset.sgml
--- old/telepathy-glib-0.12.6/docs/reference/tmpl/intset.sgml 2010-12-10 17:48:34.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/tmpl/intset.sgml 2010-12-20 16:17:25.000000000 +0100
@@ -1,5 +1,5 @@
<!-- ##### SECTION Title ##### -->
-TpIntset
+TpIntSet
<!-- ##### SECTION Short_Description ##### -->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/tmpl/message.sgml new/telepathy-glib-0.12.7/docs/reference/tmpl/message.sgml
--- old/telepathy-glib-0.12.6/docs/reference/tmpl/message.sgml 2010-12-10 17:48:34.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/tmpl/message.sgml 2010-12-20 16:17:25.000000000 +0100
@@ -9,11 +9,13 @@
</para>
+
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
+
<!-- ##### SECTION Stability_Level ##### -->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/tmpl/signalled-message.sgml new/telepathy-glib-0.12.7/docs/reference/tmpl/signalled-message.sgml
--- old/telepathy-glib-0.12.6/docs/reference/tmpl/signalled-message.sgml 2010-12-10 17:48:34.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/tmpl/signalled-message.sgml 2010-12-20 16:17:25.000000000 +0100
@@ -9,11 +9,13 @@
</para>
+
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
+
<!-- ##### SECTION Stability_Level ##### -->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/docs/reference/tmpl/telepathy-glib-unused.sgml new/telepathy-glib-0.12.7/docs/reference/tmpl/telepathy-glib-unused.sgml
--- old/telepathy-glib-0.12.6/docs/reference/tmpl/telepathy-glib-unused.sgml 2010-12-10 17:48:34.000000000 +0100
+++ new/telepathy-glib-0.12.7/docs/reference/tmpl/telepathy-glib-unused.sgml 2010-12-20 16:17:25.000000000 +0100
@@ -602,6 +602,12 @@
</para>
+<!-- ##### MACRO TP_ERRORS ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO TP_ERROR_STR_CONFUSED ##### -->
<para>
@@ -1188,6 +1194,14 @@
@parent_class:
+<!-- ##### USER_FUNCTION TpBaseChannelAddPropertiesFunc ##### -->
+<para>
+
+</para>
+
+@chan:
+@properties:
+
<!-- ##### ARG TpBaseClient:channel-factory ##### -->
<para>
@@ -1497,6 +1511,15 @@
@TP_CONTACT_METADATA_STORAGE_TYPE_SUBSCRIBED:
@TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE:
+<!-- ##### SIGNAL TpDBusDaemon::name-owner-changed ##### -->
+<para>
+
+</para>
+
+@tpdbusdaemon: the object which received the signal.
+@arg1:
+@arg2:
+
<!-- ##### STRUCT TpDTMFPlayer ##### -->
<para>
@@ -1542,6 +1565,26 @@
@TP_HTTP_METHOD_GET:
@TP_HTTP_METHOD_POST:
+<!-- ##### STRUCT TpIntSet ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT TpIntSetFastIter ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT TpIntSetIter ##### -->
+<para>
+
+</para>
+
+@set:
+@element:
+
<!-- ##### ENUM TpMailNotificationFlags ##### -->
<para>
@@ -1595,6 +1638,12 @@
@can_change_contact_list:
@get_request_uses_message:
+<!-- ##### ARG TpProtocol:authentication-types ##### -->
+<para>
+
+</para>
+
+
<!-- ##### ENUM TpSASLAbortReason ##### -->
<para>
@@ -2149,6 +2198,14 @@
@void:
@Returns:
+<!-- ##### FUNCTION tp_base_channel_get_target ##### -->
+<para>
+
+</para>
+
+@chan:
+@Returns:
+
<!-- ##### FUNCTION tp_base_client_get_channel_factory ##### -->
<para>
@@ -2183,6 +2240,13 @@
@self:
@token:
+<!-- ##### FUNCTION tp_base_connection_class_register_with_dbus_properties_mixin ##### -->
+<para>
+
+</para>
+
+@cls:
+
<!-- ##### FUNCTION tp_base_contact_list_add_to_group_async ##### -->
<para>
@@ -2794,65 +2858,11 @@
@service:
@Returns:
-<!-- ##### FUNCTION tp_channel_close_async ##### -->
-<para>
-
-</para>
-
-@self:
-@callback:
-@user_data:
-
-<!-- ##### FUNCTION tp_channel_close_finish ##### -->
-<para>
-
-</para>
-
-@self:
-@result:
-@error:
-@Returns:
-
-<!-- ##### FUNCTION tp_channel_group_leave_async ##### -->
-<para>
-
-</para>
-
-@self:
-@reason:
-@message:
-@callback:
-@user_data:
-
-<!-- ##### FUNCTION tp_channel_group_leave_finish ##### -->
-<para>
-
-</para>
-
-@self:
-@result:
-@error:
-@Returns:
-
-<!-- ##### FUNCTION tp_channel_leave_async ##### -->
-<para>
-
-</para>
-
-@self:
-@reason:
-@message:
-@callback:
-@user_data:
-
-<!-- ##### FUNCTION tp_channel_leave_finish ##### -->
+<!-- ##### FUNCTION tp_channel_manager_get_type ##### -->
<para>
</para>
-@self:
-@result:
-@error:
@Returns:
<!-- ##### FUNCTION tp_cli_account_interface_addressing_call_set_uri_scheme_association ##### -->
@@ -3205,6 +3215,33 @@
@user_data:
@weak_object:
+<!-- ##### FUNCTION tp_cli_connection_interface_capabilities_run_advertise_capabilities ##### -->
+<para>
+
+</para>
+
+@proxy:
+@timeout_ms:
+@in_Add:
+@in_Remove:
+@out_Self_Capabilities:
+@error:
+@loop:
+@Returns:
+
+<!-- ##### FUNCTION tp_cli_connection_interface_capabilities_run_get_capabilities ##### -->
+<para>
+
+</para>
+
+@proxy:
+@timeout_ms:
+@in_Handles:
+@out_Contact_Capabilities:
+@error:
+@loop:
+@Returns:
+
<!-- ##### FUNCTION tp_cli_connection_interface_client_types_call_get_client_types ##### -->
<para>
@@ -4025,15 +4062,6 @@
@error:
@Returns:
-<!-- ##### FUNCTION tp_connection_dup_contact_if_exists ##### -->
-<para>
-
-</para>
-
-@self:
-@handle:
-@Returns:
-
<!-- ##### FUNCTION tp_connection_dup_contact_if_possible ##### -->
<para>
@@ -4074,6 +4102,14 @@
@self:
@Returns:
+<!-- ##### FUNCTION tp_connection_manager_get_protocols ##### -->
+<para>
+
+</para>
+
+@self:
+@Returns:
+
<!-- ##### FUNCTION tp_contact_get_client_types ##### -->
<para>
@@ -4082,6 +4118,13 @@
@self:
@Returns:
+<!-- ##### FUNCTION tp_contacts_mixin_class_get_offset_quark ##### -->
+<para>
+
+</para>
+
+@Returns:
+
<!-- ##### FUNCTION tp_contacts_mixin_get_contact_attributes ##### -->
<para>
@@ -4094,6 +4137,13 @@
@sender:
@Returns:
+<!-- ##### FUNCTION tp_contacts_mixin_get_offset_quark ##### -->
+<para>
+
+</para>
+
+@Returns:
+
<!-- ##### FUNCTION tp_dtmf_event_to_char ##### -->
<para>
@@ -4164,21 +4214,13 @@
@intset:
@Returns:
-<!-- ##### FUNCTION tp_intset_difference_update ##### -->
+<!-- ##### FUNCTION tp_intset_new_singleton ##### -->
<para>
</para>
-@self:
-@other:
-
-<!-- ##### FUNCTION tp_intset_union_update ##### -->
-<para>
-
-</para>
-
-@self:
-@other:
+@element:
+@Returns:
<!-- ##### FUNCTION tp_message_get_received_timestamp ##### -->
<para>
@@ -4252,6 +4294,16 @@
@self:
@Returns:
+<!-- ##### FUNCTION tp_message_mixin_emit_sent ##### -->
+<para>
+
+</para>
+
+@object:
+@message:
+@token:
+@timestamp:
+
<!-- ##### FUNCTION tp_message_to_text ##### -->
<para>
@@ -4261,6 +4313,14 @@
@out_flags:
@Returns:
+<!-- ##### FUNCTION tp_protocol_get_authentication_types ##### -->
+<para>
+
+</para>
+
+@self:
+@Returns:
+
<!-- ##### FUNCTION tp_signalled_message_get_sender ##### -->
<para>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/NEWS new/telepathy-glib-0.12.7/NEWS
--- old/telepathy-glib-0.12.6/NEWS 2010-12-10 17:24:32.000000000 +0100
+++ new/telepathy-glib-0.12.7/NEWS 2010-12-20 16:11:41.000000000 +0100
@@ -1,3 +1,20 @@
+telepathy-glib 0.12.7 (2010-12-20)
+==================================
+
+The ‘I hand him my $25 and I says “here’s my money; now I am leaving.”’
+release.
+
+Fixes:
+
+• tp_account_manager_ensure_account() no longer criticals if you pass it a
+ malformed account path. (wjt)
+
+• TpBaseClient will now return (an error) from ObserveChannels if an invalid
+ connection path is passed to it by the Channel Dispatcher. (wjt)
+
+• fd.o #32391: correctly deal with removing name owner watches during
+ dispatch of their callbacks (wjt, smcv)
+
telepathy-glib 0.12.6 (2010-12-10)
==================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/telepathy-glib/account-manager.c new/telepathy-glib-0.12.7/telepathy-glib/account-manager.c
--- old/telepathy-glib-0.12.6/telepathy-glib/account-manager.c 2010-12-10 17:23:56.000000000 +0100
+++ new/telepathy-glib-0.12.7/telepathy-glib/account-manager.c 2010-12-20 16:08:57.000000000 +0100
@@ -871,7 +871,8 @@
* The caller must keep a ref to the returned object using g_object_ref() if
* it is to be kept.
*
- * Returns: (transfer none): a new #TpAccount at @path
+ * Returns: (transfer none): a new #TpAccount at @path, or %NULL if @path is
+ * not a valid account path.
*
* Since: 0.9.0
*/
@@ -882,6 +883,7 @@
TpAccountManagerPrivate *priv;
TpAccount *account;
GQuark fs[] = { TP_ACCOUNT_FEATURE_CORE, 0 };
+ GError *error = NULL;
g_return_val_if_fail (TP_IS_ACCOUNT_MANAGER (manager), NULL);
g_return_val_if_fail (path != NULL, NULL);
@@ -892,13 +894,17 @@
if (account != NULL)
return account;
- account = tp_account_new (tp_proxy_get_dbus_daemon (manager), path, NULL);
- g_return_val_if_fail (account != NULL, NULL);
- g_hash_table_insert (priv->accounts, g_strdup (path), account);
+ account = tp_account_new (tp_proxy_get_dbus_daemon (manager), path, &error);
+ if (account == NULL)
+ {
+ DEBUG ("tp_account_new() failed: %s", error->message);
+ g_clear_error (&error);
+ return NULL;
+ }
+ g_hash_table_insert (priv->accounts, g_strdup (path), account);
tp_account_prepare_async (account, fs, _tp_account_manager_account_ready_cb,
g_object_ref (manager));
-
return account;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/telepathy-glib/base-client.c new/telepathy-glib-0.12.7/telepathy-glib/base-client.c
--- old/telepathy-glib-0.12.6/telepathy-glib/base-client.c 2010-12-10 17:23:56.000000000 +0100
+++ new/telepathy-glib-0.12.7/telepathy-glib/base-client.c 2010-12-20 16:08:57.000000000 +0100
@@ -1482,7 +1482,10 @@
connection = tp_account_ensure_connection (account, connection_path);
if (connection == NULL)
{
- DEBUG ("Failed to create TpConnection");
+ g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
+ "Connection %s doesn't seem to exist. (Maybe the CM doesn't own "
+ "the corresponding bus name?)", connection_path);
+ DEBUG ("Failed to create TpConnection: %s", error->message);
goto out;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/telepathy-glib/dbus-daemon.c new/telepathy-glib-0.12.7/telepathy-glib/dbus-daemon.c
--- old/telepathy-glib-0.12.6/telepathy-glib/dbus-daemon.c 2010-11-10 13:26:16.000000000 +0100
+++ new/telepathy-glib-0.12.7/telepathy-glib/dbus-daemon.c 2010-12-20 16:06:24.000000000 +0100
@@ -149,10 +149,9 @@
typedef struct
{
- TpDBusDaemonNameOwnerChangedCb callback;
- gpointer user_data;
- GDestroyNotify destroy;
gchar *last_owner;
+ GArray *callbacks;
+ gsize invoking;
} _NameOwnerWatch;
typedef struct
@@ -162,40 +161,44 @@
GDestroyNotify destroy;
} _NameOwnerSubWatch;
+static void _tp_dbus_daemon_stop_watching (TpDBusDaemon *self,
+ const gchar *name, _NameOwnerWatch *watch);
+
static void
-_tp_dbus_daemon_name_owner_changed_multiple (TpDBusDaemon *self,
- const gchar *name,
- const gchar *new_owner,
- gpointer user_data)
-{
- GArray *array = user_data;
+tp_dbus_daemon_maybe_free_name_owner_watch (TpDBusDaemon *self,
+ const gchar *name,
+ _NameOwnerWatch *watch)
+{
+ /* Check to see whether this (callback, user_data) pair is in the watch's
+ * array of callbacks. */
+ GArray *array = watch->callbacks;
+ /* 1 greater than an index into @array, to avoid it going negative: we
+ * iterate in reverse so we can delete elements without needing to adjust
+ * @i to compensate */
guint i;
- for (i = 0; i < array->len; i++)
- {
- _NameOwnerSubWatch *watch = &g_array_index (array, _NameOwnerSubWatch,
- i);
+ if (watch->invoking > 0)
+ return;
- watch->callback (self, name, new_owner, watch->user_data);
- }
-}
+ for (i = array->len; i > 0; i--)
+ {
+ _NameOwnerSubWatch *entry = &g_array_index (array,
+ _NameOwnerSubWatch, i - 1);
-static void
-_tp_dbus_daemon_name_owner_changed_multiple_free (gpointer data)
-{
- GArray *array = data;
- guint i;
+ if (entry->callback != NULL)
+ continue;
- for (i = 0; i < array->len; i++)
- {
- _NameOwnerSubWatch *watch = &g_array_index (array, _NameOwnerSubWatch,
- i);
+ if (entry->destroy != NULL)
+ entry->destroy (entry->user_data);
- if (watch->destroy)
- watch->destroy (watch->user_data);
+ g_array_remove_index (array, i - 1);
}
- g_array_free (array, TRUE);
+ if (array->len == 0)
+ {
+ _tp_dbus_daemon_stop_watching (self, name, watch);
+ g_hash_table_remove (self->priv->name_owner_watches, name);
+ }
}
static void
@@ -205,6 +208,8 @@
{
_NameOwnerWatch *watch = g_hash_table_lookup (self->priv->name_owner_watches,
name);
+ GArray *array;
+ guint i;
if (watch == NULL)
return;
@@ -221,7 +226,26 @@
g_free (watch->last_owner);
watch->last_owner = g_strdup (new_owner);
- watch->callback (self, name, new_owner, watch->user_data);
+ /* We're calling out to user code which might end up removing its watch;
+ * tell it to be less destructive. Also hold a ref on self, to avoid it
+ * getting removed that way. */
+ array = watch->callbacks;
+ g_object_ref (self);
+ watch->invoking++;
+
+ for (i = 0; i < array->len; i++)
+ {
+ _NameOwnerSubWatch *subwatch = &g_array_index (array,
+ _NameOwnerSubWatch, i);
+
+ if (subwatch->callback != NULL)
+ subwatch->callback (self, name, new_owner, subwatch->user_data);
+ }
+
+ watch->invoking--;
+
+ tp_dbus_daemon_maybe_free_name_owner_watch (self, name, watch);
+ g_object_unref (self);
}
static dbus_int32_t daemons_slot = -1;
@@ -287,7 +311,9 @@
GSList *iter;
for (iter = *daemons; iter != NULL; iter = iter->next)
- _tp_dbus_daemon_name_owner_changed (iter->data, name, new_owner);
+ {
+ _tp_dbus_daemon_name_owner_changed (iter->data, name, new_owner);
+ }
}
return FALSE;
@@ -470,6 +496,7 @@
{
_NameOwnerWatch *watch = g_hash_table_lookup (self->priv->name_owner_watches,
name);
+ _NameOwnerSubWatch tmp = { callback, user_data, destroy };
g_return_if_fail (TP_IS_DBUS_DAEMON (self));
g_return_if_fail (tp_dbus_check_valid_bus_name (name,
@@ -483,12 +510,11 @@
DBusPendingCall *pc = NULL;
GetNameOwnerContext *context = get_name_owner_context_new (self, name);
- /* Allocate a single watch (common case) */
- watch = g_slice_new (_NameOwnerWatch);
- watch->callback = callback;
- watch->user_data = user_data;
- watch->destroy = destroy;
+ /* Allocate a new watch */
+ watch = g_slice_new0 (_NameOwnerWatch);
watch->last_owner = NULL;
+ watch->callbacks = g_array_new (FALSE, FALSE,
+ sizeof (_NameOwnerSubWatch));
g_hash_table_insert (self->priv->name_owner_watches, g_strdup (name),
watch);
@@ -533,42 +559,13 @@
ERROR ("Out of memory");
}
}
- else
- {
- _NameOwnerSubWatch tmp = { callback, user_data, destroy };
-
- if (watch->callback == _tp_dbus_daemon_name_owner_changed_multiple)
- {
- /* The watch is already a "multiplexer", just append to it */
- GArray *array = watch->user_data;
- g_array_append_val (array, tmp);
- }
- else
- {
- /* Replace the old contents of the watch with one that dispatches
- * the signal to (potentially) more than one watcher */
- GArray *array = g_array_sized_new (FALSE, FALSE,
- sizeof (_NameOwnerSubWatch), 2);
-
- /* The new watcher */
- g_array_append_val (array, tmp);
- /* The old watcher */
- tmp.callback = watch->callback;
- tmp.user_data = watch->user_data;
- tmp.destroy = watch->destroy;
- g_array_prepend_val (array, tmp);
-
- watch->callback = _tp_dbus_daemon_name_owner_changed_multiple;
- watch->user_data = array;
- watch->destroy = _tp_dbus_daemon_name_owner_changed_multiple_free;
- }
+ g_array_append_val (watch->callbacks, tmp);
- if (watch->last_owner != NULL)
- {
- /* FIXME: should avoid reentrancy? */
- callback (self, name, watch->last_owner, user_data);
- }
+ if (watch->last_owner != NULL)
+ {
+ /* FIXME: should avoid reentrancy? */
+ callback (self, name, watch->last_owner, user_data);
}
}
@@ -579,9 +576,22 @@
{
gchar *match_rule;
- if (watch->destroy)
- watch->destroy (watch->user_data);
+ /* Clean up any leftöver callbacks. */
+ if (watch->callbacks->len > 0)
+ {
+ guint i;
+
+ for (i = 0; i < watch->callbacks->len; i++)
+ {
+ _NameOwnerSubWatch *entry = &g_array_index (watch->callbacks,
+ _NameOwnerSubWatch, i);
+
+ if (entry->destroy != NULL)
+ entry->destroy (entry->user_data);
+ }
+ }
+ g_array_unref (watch->callbacks);
g_free (watch->last_owner);
g_slice_free (_NameOwnerWatch, watch);
@@ -621,43 +631,24 @@
g_return_val_if_fail (name != NULL, FALSE);
g_return_val_if_fail (callback != NULL, FALSE);
- if (watch == NULL)
- {
- /* No watch at all */
- return FALSE;
- }
- else if (watch->callback == callback && watch->user_data == user_data)
+ if (watch != NULL)
{
- /* Simple case: there is one name-owner watch and it's what we wanted */
- _tp_dbus_daemon_stop_watching (self, name, watch);
- g_hash_table_remove (self->priv->name_owner_watches, name);
- return TRUE;
- }
- else if (watch->callback == _tp_dbus_daemon_name_owner_changed_multiple)
- {
- /* Complicated case: this watch is a "multiplexer", we need to check
- * its contents */
- GArray *array = watch->user_data;
+ /* Check to see whether this (callback, user_data) pair is in the watch's
+ * array of callbacks. */
+ GArray *array = watch->callbacks;
+ /* 1 greater than an index into @array, to avoid it going negative;
+ * we iterate in reverse to have "last in = first out" as documented. */
guint i;
- for (i = 1; i <= array->len; i++)
+ for (i = array->len; i > 0; i--)
{
_NameOwnerSubWatch *entry = &g_array_index (array,
- _NameOwnerSubWatch, array->len - i);
+ _NameOwnerSubWatch, i - 1);
if (entry->callback == callback && entry->user_data == user_data)
{
- if (entry->destroy != NULL)
- entry->destroy (entry->user_data);
-
- g_array_remove_index (array, array->len - i);
-
- if (array->len == 0)
- {
- _tp_dbus_daemon_stop_watching (self, name, watch);
- g_hash_table_remove (self->priv->name_owner_watches, name);
- }
-
+ entry->callback = NULL;
+ tp_dbus_daemon_maybe_free_name_owner_watch (self, name, watch);
return TRUE;
}
}
@@ -1337,7 +1328,11 @@
while (g_hash_table_iter_next (&iter, &k, &v))
{
- _tp_dbus_daemon_stop_watching (self, k, v);
+ _NameOwnerWatch *watch = v;
+
+ /* it refs us while invoking stuff */
+ g_assert (watch->invoking == 0);
+ _tp_dbus_daemon_stop_watching (self, k, watch);
g_hash_table_iter_remove (&iter);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-glib-0.12.6/tests/dbus/dbus.c new/telepathy-glib-0.12.7/tests/dbus/dbus.c
--- old/telepathy-glib-0.12.6/tests/dbus/dbus.c 2010-12-10 17:23:56.000000000 +0100
+++ new/telepathy-glib-0.12.7/tests/dbus/dbus.c 2010-12-20 16:08:57.000000000 +0100
@@ -4,10 +4,130 @@
#include
#include
-#include "tests/lib/myassert.h"
+static void
+test_validation (void)
+{
+ g_assert (tp_dbus_check_valid_object_path ("/", NULL));
+ g_assert (tp_dbus_check_valid_object_path ("/a", NULL));
+ g_assert (tp_dbus_check_valid_object_path ("/foo", NULL));
+ g_assert (!tp_dbus_check_valid_object_path ("//", NULL));
+ g_assert (!tp_dbus_check_valid_object_path ("/a//b", NULL));
+ g_assert (tp_dbus_check_valid_object_path ("/a/b", NULL));
+ g_assert (!tp_dbus_check_valid_object_path ("/a/b/", NULL));
+ g_assert (!tp_dbus_check_valid_object_path ("a/b", NULL));
+ g_assert (!tp_dbus_check_valid_object_path ("/*a", NULL));
+
+#define TEST_LONG_BIT "excessively.long.name.longer.than._255.characters"
+#define TEST_LONG (TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT \
+ TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT)
+
+ g_assert (!tp_dbus_check_valid_member_name ("", NULL));
+ g_assert (!tp_dbus_check_valid_member_name ("123abc", NULL));
+ g_assert (!tp_dbus_check_valid_member_name ("a.b", NULL));
+ g_assert (!tp_dbus_check_valid_member_name ("a*b", NULL));
+ g_assert (tp_dbus_check_valid_member_name ("example", NULL));
+ g_assert (tp_dbus_check_valid_member_name ("_1", NULL));
+
+ g_assert (!tp_dbus_check_valid_interface_name ("", NULL));
+ g_assert (!tp_dbus_check_valid_interface_name (TEST_LONG, NULL));
+ g_assert (!tp_dbus_check_valid_interface_name ("hasnodot", NULL));
+ g_assert (!tp_dbus_check_valid_interface_name ("123abc.example", NULL));
+ g_assert (!tp_dbus_check_valid_interface_name ("com.1", NULL));
+ g_assert (!tp_dbus_check_valid_interface_name ("com.e*ample", NULL));
+ g_assert (!tp_dbus_check_valid_interface_name ("com..example", NULL));
+ g_assert (!tp_dbus_check_valid_interface_name (".com.example", NULL));
+ g_assert (!tp_dbus_check_valid_interface_name ("com.example.", NULL));
+ g_assert (tp_dbus_check_valid_interface_name ("com.example", NULL));
+ g_assert (tp_dbus_check_valid_interface_name ("com._1", NULL));
+
+ g_assert (tp_dbus_check_valid_bus_name (":1.1", TP_DBUS_NAME_TYPE_ANY,
+ NULL));
+ g_assert (tp_dbus_check_valid_bus_name ("com.example", TP_DBUS_NAME_TYPE_ANY,
+ NULL));
+ g_assert (tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+
+ g_assert (tp_dbus_check_valid_bus_name (":1.1",
+ TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL));
+ g_assert (tp_dbus_check_valid_bus_name ("com.example",
+ TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
+ TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL));
+
+ g_assert (!tp_dbus_check_valid_bus_name (":1.1",
+ TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("com.example",
+ TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL));
+ g_assert (tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
+ TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL));
+
+ g_assert (!tp_dbus_check_valid_bus_name (":1.1",
+ TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL));
+ g_assert (tp_dbus_check_valid_bus_name ("com.example",
+ TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
+ TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL));
+
+ g_assert (tp_dbus_check_valid_bus_name (":1.1",
+ TP_DBUS_NAME_TYPE_UNIQUE, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("com.example",
+ TP_DBUS_NAME_TYPE_UNIQUE, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
+ TP_DBUS_NAME_TYPE_UNIQUE, NULL));
+
+ g_assert (tp_dbus_check_valid_bus_name ("com._1",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name (TEST_LONG,
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("hasnodot",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("123abc.example",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("com.1",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("com.e*ample",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("com..example",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name (".com.example",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name ("com.example.",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+ g_assert (!tp_dbus_check_valid_bus_name (":1.1.",
+ TP_DBUS_NAME_TYPE_ANY, NULL));
+}
+
+static void
+test_properties (void)
+{
+ TpDBusDaemon *bus = tp_dbus_daemon_dup (NULL);
+ gchar *bus_name;
+ gchar *object_path;
+ DBusGConnection *dbus_conn;
+
+ g_object_get (bus,
+ "dbus-connection", &dbus_conn,
+ "bus-name", &bus_name,
+ "object-path", &object_path,
+ NULL);
+
+ if (object_path[0] != '/')
+ g_error ("supposed object-path \"%s\" doesn't start with a /",
+ object_path);
+
+ g_assert_cmpstr (bus_name, ==, "org.freedesktop.DBus");
+ g_assert (dbus_conn != NULL);
+ g_assert (dbus_conn == tp_get_bus ());
+
+ g_free (bus_name);
+ g_free (object_path);
+ dbus_g_connection_unref (dbus_conn);
+ g_object_unref (bus);
+}
static GPtrArray *events;
-static TpDBusDaemon *bus;
static GMainLoop *mainloop;
static gchar *two = "2", *five = "5";
static gboolean had_owners = FALSE;
@@ -41,15 +161,15 @@
guint ret;
GError *error = NULL;
- MYASSERT (tp_cli_dbus_daemon_run_request_name (obj, -1,
- "com.example", 0, &ret, &error, NULL), "");
- MYASSERT (ret == 1 && error == NULL, "");
- MYASSERT (tp_cli_dbus_daemon_run_request_name (obj, -1,
- "org.example", 0, &ret, &error, NULL), "");
- MYASSERT (ret == 1 && error == NULL, "");
- MYASSERT (tp_cli_dbus_daemon_run_request_name (obj, -1,
- "net.example", 0, &ret, &error, NULL), "");
- MYASSERT (ret == 1 && error == NULL, "");
+ g_assert (tp_cli_dbus_daemon_run_request_name (obj, -1,
+ "com.example", 0, &ret, &error, NULL));
+ g_assert (ret == 1 && error == NULL);
+ g_assert (tp_cli_dbus_daemon_run_request_name (obj, -1,
+ "org.example", 0, &ret, &error, NULL));
+ g_assert (ret == 1 && error == NULL);
+ g_assert (tp_cli_dbus_daemon_run_request_name (obj, -1,
+ "net.example", 0, &ret, &error, NULL));
+ g_assert (ret == 1 && error == NULL);
}
}
else
@@ -57,150 +177,26 @@
guint ret;
GError *error = NULL;
- MYASSERT (tp_dbus_daemon_cancel_name_owner_watch (obj,
- "org.example", noc, five), "");
- MYASSERT (tp_cli_dbus_daemon_run_release_name (obj, -1,
- "org.example", &ret, &error, NULL), "");
- MYASSERT (ret == 1 && error == NULL, "");
- MYASSERT (tp_cli_dbus_daemon_run_release_name (obj, -1,
- "net.example", &ret, &error, NULL), "");
- MYASSERT (ret == 1 && error == NULL, "");
+ g_assert (tp_dbus_daemon_cancel_name_owner_watch (obj,
+ "org.example", noc, five));
+ g_assert (tp_cli_dbus_daemon_run_release_name (obj, -1,
+ "org.example", &ret, &error, NULL));
+ g_assert (ret == 1 && error == NULL);
+ g_assert (tp_cli_dbus_daemon_run_release_name (obj, -1,
+ "net.example", &ret, &error, NULL));
+ g_assert (ret == 1 && error == NULL);
}
}
}
-int
-main (int argc,
- char **argv)
+static void
+test_watch_name_owner (void)
{
+ TpDBusDaemon *bus = tp_dbus_daemon_dup (NULL);
guint i;
- tp_debug_set_flags ("all");
- mainloop = g_main_loop_new (NULL, FALSE);
-
events = g_ptr_array_new ();
- g_type_init ();
-
- MYASSERT (tp_dbus_check_valid_object_path ("/", NULL), "");
- MYASSERT (tp_dbus_check_valid_object_path ("/a", NULL), "");
- MYASSERT (tp_dbus_check_valid_object_path ("/foo", NULL), "");
- MYASSERT (!tp_dbus_check_valid_object_path ("//", NULL), "");
- MYASSERT (!tp_dbus_check_valid_object_path ("/a//b", NULL), "");
- MYASSERT (tp_dbus_check_valid_object_path ("/a/b", NULL), "");
- MYASSERT (!tp_dbus_check_valid_object_path ("/a/b/", NULL), "");
- MYASSERT (!tp_dbus_check_valid_object_path ("a/b", NULL), "");
- MYASSERT (!tp_dbus_check_valid_object_path ("/*a", NULL), "");
-
-#define TEST_LONG_BIT "excessively.long.name.longer.than._255.characters"
-#define TEST_LONG (TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT \
- TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT)
-
- MYASSERT (!tp_dbus_check_valid_member_name ("", NULL), "");
- MYASSERT (!tp_dbus_check_valid_member_name ("123abc", NULL), "");
- MYASSERT (!tp_dbus_check_valid_member_name ("a.b", NULL), "");
- MYASSERT (!tp_dbus_check_valid_member_name ("a*b", NULL), "");
- MYASSERT (tp_dbus_check_valid_member_name ("example", NULL), "");
- MYASSERT (tp_dbus_check_valid_member_name ("_1", NULL), "");
-
- MYASSERT (!tp_dbus_check_valid_interface_name ("", NULL), "");
- MYASSERT (!tp_dbus_check_valid_interface_name (TEST_LONG, NULL), "");
- MYASSERT (!tp_dbus_check_valid_interface_name ("hasnodot", NULL), "");
- MYASSERT (!tp_dbus_check_valid_interface_name ("123abc.example", NULL), "");
- MYASSERT (!tp_dbus_check_valid_interface_name ("com.1", NULL), "");
- MYASSERT (!tp_dbus_check_valid_interface_name ("com.e*ample", NULL), "");
- MYASSERT (!tp_dbus_check_valid_interface_name ("com..example", NULL), "");
- MYASSERT (!tp_dbus_check_valid_interface_name (".com.example", NULL), "");
- MYASSERT (!tp_dbus_check_valid_interface_name ("com.example.", NULL), "");
- MYASSERT (tp_dbus_check_valid_interface_name ("com.example", NULL), "");
- MYASSERT (tp_dbus_check_valid_interface_name ("com._1", NULL), "");
-
- MYASSERT (tp_dbus_check_valid_bus_name (":1.1", TP_DBUS_NAME_TYPE_ANY,
- NULL), "");
- MYASSERT (tp_dbus_check_valid_bus_name ("com.example", TP_DBUS_NAME_TYPE_ANY,
- NULL), "");
- MYASSERT (tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
-
- MYASSERT (tp_dbus_check_valid_bus_name (":1.1",
- TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL), "");
- MYASSERT (tp_dbus_check_valid_bus_name ("com.example",
- TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
- TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL), "");
-
- MYASSERT (!tp_dbus_check_valid_bus_name (":1.1",
- TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("com.example",
- TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL), "");
- MYASSERT (tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
- TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL), "");
-
- MYASSERT (!tp_dbus_check_valid_bus_name (":1.1",
- TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL), "");
- MYASSERT (tp_dbus_check_valid_bus_name ("com.example",
- TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
- TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL), "");
-
- MYASSERT (tp_dbus_check_valid_bus_name (":1.1",
- TP_DBUS_NAME_TYPE_UNIQUE, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("com.example",
- TP_DBUS_NAME_TYPE_UNIQUE, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS,
- TP_DBUS_NAME_TYPE_UNIQUE, NULL), "");
-
- MYASSERT (tp_dbus_check_valid_bus_name ("com._1",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name (TEST_LONG,
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("hasnodot",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("123abc.example",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("com.1",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("com.e*ample",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("com..example",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name (".com.example",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name ("com.example.",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
- MYASSERT (!tp_dbus_check_valid_bus_name (":1.1.",
- TP_DBUS_NAME_TYPE_ANY, NULL), "");
-
- bus = tp_dbus_daemon_new (tp_get_bus ());
-
- /* Regression test for properties */
- {
- gchar *bus_name;
- gchar *object_path;
- DBusGConnection *dbus_conn;
-
- g_object_get (bus,
- "dbus-connection", &dbus_conn,
- "bus-name", &bus_name,
- "object-path", &object_path,
- NULL);
-
- MYASSERT (object_path != NULL, "");
- MYASSERT (object_path[0] == '/', "%s", object_path);
- MYASSERT (bus_name != NULL, "");
- MYASSERT (!tp_strdiff (bus_name, "org.freedesktop.DBus"),
- "%s", bus_name);
- MYASSERT (dbus_conn != NULL, "");
- MYASSERT (dbus_conn == tp_get_bus (), "%p != %p", dbus_conn,
- tp_get_bus ());
-
- g_free (bus_name);
- g_free (object_path);
- dbus_g_connection_unref (dbus_conn);
- }
-
tp_dbus_daemon_watch_name_owner (bus, "com.example", noc, "1", NULL);
tp_dbus_daemon_watch_name_owner (bus, "com.example", noc, two, NULL);
tp_dbus_daemon_watch_name_owner (bus, "com.example", noc, "3", NULL);
@@ -208,30 +204,22 @@
tp_dbus_daemon_watch_name_owner (bus, "net.example", noc, "4", NULL);
tp_dbus_daemon_watch_name_owner (bus, "org.example", noc, five, NULL);
+ mainloop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (mainloop);
- MYASSERT (events->len == 9, "");
+ g_assert_cmpuint (events->len, ==, 9);
/* 58 == ':' - i.e. the beginning of a unique name */
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 0),
- "[1] com.example 0"), "");
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 1),
- "[3] com.example 0"), "");
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 2),
- "[4] net.example 0"), "");
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 3),
- "[5] org.example 0"), "");
-
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 4),
- "[1] com.example 58"), "");
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 5),
- "[3] com.example 58"), "");
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 6),
- "[5] org.example 58"), "");
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 7),
- "[4] net.example 58"), "");
- MYASSERT (!tp_strdiff (g_ptr_array_index (events, 8),
- "[4] net.example 0"), "");
+ g_assert_cmpstr (g_ptr_array_index (events, 0), ==, "[1] com.example 0");
+ g_assert_cmpstr (g_ptr_array_index (events, 1), ==, "[3] com.example 0");
+ g_assert_cmpstr (g_ptr_array_index (events, 2), ==, "[4] net.example 0");
+ g_assert_cmpstr (g_ptr_array_index (events, 3), ==, "[5] org.example 0");
+
+ g_assert_cmpstr (g_ptr_array_index (events, 4), ==, "[1] com.example 58");
+ g_assert_cmpstr (g_ptr_array_index (events, 5), ==, "[3] com.example 58");
+ g_assert_cmpstr (g_ptr_array_index (events, 6), ==, "[5] org.example 58");
+ g_assert_cmpstr (g_ptr_array_index (events, 7), ==, "[4] net.example 58");
+ g_assert_cmpstr (g_ptr_array_index (events, 8), ==, "[4] net.example 0");
/* keep valgrind happy, at least in the successful case */
for (i = 0; i < events->len; i++)
@@ -242,6 +230,116 @@
g_ptr_array_free (events, TRUE);
g_main_loop_unref (mainloop);
mainloop = NULL;
+}
+
+/* Here's a regression test for a bug where, if a name owner watch callback
+ * removes itself, subsequent callbacks for the same change would not fire.
+ * This was because the implementation was an array of callbacks, with an index
+ * i, calling each in turn. So imagine we're dispatching three callbacks,
+ * starting with 'foo':
+ *
+ * | foo | bar | baz |
+ * i=0
+ *
+ * If 'foo' cancels its own watch, it would be removed from the array. Then the
+ * iteration would continue by incrementing i:
+ *
+ * | bar | baz |
+ * i=1
+ *
+ * and 'bar' has not been called! Gulp. This test checks this case by setting
+ * up ten numbered callbacks, each one of which removes itself and itself ±1,
+ * so that each of (0, 1), (2, 3), (4, 5), (6, 7), (8, 9) should fire exactly
+ * once. It should work regardless of the internal order of callbacks.
+ */
+#define N_CALLBACK_PAIRS 5
+gboolean callbacks_fired[N_CALLBACK_PAIRS] =
+ { FALSE, FALSE, FALSE, FALSE, FALSE };
+/* Overwritten with '.' when "freed" */
+gchar user_data_flags[N_CALLBACK_PAIRS * 2 + 1] = "0123456789";
+
+static void
+free_fake_user_data (gpointer user_data)
+{
+ guint i = GPOINTER_TO_UINT (user_data);
+
+ if (user_data_flags[i] == '.')
+ g_error ("Double 'free' of user-data %u. Still to free: %s", i,
+ user_data_flags);
+
+ g_assert_cmpuint ((guint) user_data_flags[i], ==, i + '0');
+ user_data_flags[i] = '.';
+}
+
+static void
+bbf3_performed_cb (
+ TpDBusDaemon *bus_daemon,
+ const gchar *name,
+ const gchar *new_owner,
+ gpointer user_data)
+{
+ guint i = GPOINTER_TO_UINT (user_data);
+ guint even = i - (i % 2);
+ guint odd = even + 1;
+ guint j;
+
+ g_message ("%u fired; cancelling %u and %u", i, even, odd);
+ tp_dbus_daemon_cancel_name_owner_watch (bus_daemon, name, bbf3_performed_cb,
+ GUINT_TO_POINTER (even));
+ tp_dbus_daemon_cancel_name_owner_watch (bus_daemon, name, bbf3_performed_cb,
+ GUINT_TO_POINTER (odd));
+
+ g_assert (!callbacks_fired[even / 2]);
+ callbacks_fired[even / 2] = TRUE;
+
+ for (j = 0; j < N_CALLBACK_PAIRS; j++)
+ if (!callbacks_fired[j])
+ {
+ g_message ("still waiting for %u or %u, at least", j * 2, j * 2 + 1);
+ return;
+ }
+
+ g_main_loop_quit (mainloop);
+}
+
+static void
+cancel_watch_during_dispatch (void)
+{
+ TpDBusDaemon *bus = tp_dbus_daemon_dup (NULL);
+ guint i;
+
+ tp_dbus_daemon_request_name (bus, "ca.bbf3", FALSE, NULL);
+
+ for (i = 0; i < N_CALLBACK_PAIRS * 2; i++)
+ {
+ tp_dbus_daemon_watch_name_owner (bus, "ca.bbf3", bbf3_performed_cb,
+ GUINT_TO_POINTER (i), free_fake_user_data);
+ g_assert_cmpuint ((guint) user_data_flags[i], ==, i + '0');
+ }
+
+ mainloop = g_main_loop_new (NULL, FALSE);
+ g_main_loop_run (mainloop);
+ g_main_loop_unref (mainloop);
+ g_object_unref (bus);
+
+ /* everything should have been "freed" */
+ g_assert_cmpstr (user_data_flags, ==, "..........");
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ g_type_init ();
+ g_test_init (&argc, &argv, NULL);
+
+ tp_debug_set_flags ("all");
+
+ g_test_add_func ("/dbus/validation", test_validation);
+ g_test_add_func ("/dbus-daemon/properties", test_properties);
+ g_test_add_func ("/dbus-daemon/watch-name-owner", test_watch_name_owner);
+ g_test_add_func ("/dbus-daemon/cancel-watch-during-dispatch",
+ cancel_watch_during_dispatch);
- return 0;
+ return g_test_run ();
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org