summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2008-04-03 13:15:45 -0400
committerJohn (J5) Palmieri <johnp@redhat.com>2008-04-03 13:15:45 -0400
commitb5818e619f6258cc6d530ee62e99bd019b6d069b (patch)
treecda4f5cd483c383874fe8d7dd6455452ab48eb38
parenta689ef29f176110b0f74e47fd5dd1d2d6ad3dfd3 (diff)
modify dbus_connection_send documentation
* dbus/dbus-connection.c (dbus_connection_send): add documentation to describe when to call dbus_connection_flush and dbus_connection_unref after a call to dbus_connection_send is made Initial wording by Stanislav Brabec <sbrabec at suse.cz> (fd.o bug#13558)
-rw-r--r--ChangeLog8
-rw-r--r--dbus/dbus-connection.c18
2 files changed, 20 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ae1f7be0..edca8110 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2008-04-03 John (J5) Palmieri <johnp@redhat.com>
+ * dbus/dbus-connection.c (dbus_connection_send): add documentation
+ to describe when to call dbus_connection_flush and
+ dbus_connection_unref after a call to dbus_connection_send is made
+ Initial wording by Stanislav Brabec <sbrabec at suse.cz>
+ (fd.o bug#13558)
+
+2008-04-03 John (J5) Palmieri <johnp@redhat.com>
+
Patch from Jérémie Dimino <jeremie at dimino.org>
* tools/dbus-send.c (append_dict): Send in signature when opening up
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 9439f63f..3a1670ca 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -3055,18 +3055,24 @@ _dbus_connection_send_unlocked_no_update (DBusConnection *connection,
/**
* Adds a message to the outgoing message queue. Does not block to
* write the message to the network; that happens asynchronously. To
- * force the message to be written, call dbus_connection_flush().
+ * force the message to be written, call dbus_connection_flush() however
+ * it is not necessary to call dbus_connection_flush() by hand; the
+ * message will be sent the next time the main loop is run.
+ * dbus_connection_flush() should only be used, for example, if
+ * the application was expected to exit before running the main loop.
+ *
* Because this only queues the message, the only reason it can
* fail is lack of memory. Even if the connection is disconnected,
- * no error will be returned.
- *
- * If the function fails due to lack of memory, it returns #FALSE.
- * The function will never fail for other reasons; even if the
- * connection is disconnected, you can queue an outgoing message,
+ * no error will be returned. If the function fails due to lack of memory,
+ * it returns #FALSE. The function will never fail for other reasons; even
+ * if the connection is disconnected, you can queue an outgoing message,
* though obviously it won't be sent.
*
* The message serial is used by the remote application to send a
* reply; see dbus_message_get_serial() or the D-Bus specification.
+ *
+ * dbus_message_unref() can be called as soon as this method returns
+ * as the message queue will hold its own ref until the message is sent.
*
* @param connection the connection.
* @param message the message to write.