dbus/test test-service.c,1.12,1.13

Havoc Pennington hp@pdx.freedesktop.org
Wed, 15 Oct 2003 23:34:53 -0700


Update of /cvs/dbus/dbus/test
In directory pdx:/tmp/cvs-serv10532/test

Modified Files:
	test-service.c 
Log Message:
2003-10-16  Havoc Pennington  <hp@redhat.com>

	* bus/connection.c (bus_pending_reply_expired): either cancel or
	execute, not both
	(bus_connections_check_reply): use unlink, not remove_link, as we
	don't want to free the link; fixes double free mess

	* dbus/dbus-pending-call.c (dbus_pending_call_block): fix in case
	where no reply was received

	* dbus/dbus-connection.c (_dbus_pending_call_complete_and_unlock):
	fix a refcount leak

	* bus/signals.c (match_rule_matches): add special cases for the
	bus driver, so you can match on sender/destination for it.

	* dbus/dbus-sysdeps.c (_dbus_abort): print backtrace if
	DBUS_PRINT_BACKTRACE is set

	* dbus/dbus-internals.c: add pid to assertion failure messages

	* dbus/dbus-connection.c: add message type code to the debug spew

	* glib/dbus-gproxy.c (gproxy_get_match_rule): match rules want
	sender=foo not service=foo

	* dbus/dbus-bus.c (dbus_bus_get): if the activation bus is the
	session bus but DBUS_SESSION_BUS_ADDRESS isn't set, use 
	DBUS_ACTIVATION_ADDRESS instead

	* bus/activation.c: set DBUS_SESSION_BUS_ADDRESS,
	DBUS_SYSTEM_BUS_ADDRESS if appropriate

	* bus/bus.c (bus_context_new): handle OOM copying bus type into
	context struct

	* dbus/dbus-message.c (dbus_message_iter_get_object_path): new function
	(dbus_message_iter_get_object_path_array): new function (half
	finished, disabled for the moment)
	
	* glib/dbus-gproxy.c (dbus_gproxy_end_call): properly handle
	DBUS_MESSAGE_TYPE_ERROR

	* tools/dbus-launch.c (babysit): support DBUS_DEBUG_OUTPUT to
	avoid redirecting stderr to /dev/null
	(babysit): close stdin if not doing the "exit_with_session" thing

	* dbus/dbus-sysdeps.c (_dbus_become_daemon): delete some leftover
	debug code; change DBUS_DEBUG_OUTPUT to only enable stderr, not
	stdout/stdin, so things don't get confused
	
	* bus/system.conf.in: fix to allow replies, I modified .conf
	instead of .conf.in again.



Index: test-service.c
===================================================================
RCS file: /cvs/dbus/dbus/test/test-service.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- test-service.c	30 Sep 2003 02:32:59 -0000	1.12
+++ test-service.c	16 Oct 2003 06:34:51 -0000	1.13
@@ -27,7 +27,6 @@
 {
   DBusError error;
   DBusMessage *reply;
-  DBusMessageIter iter;
   char *s;
   
   dbus_error_init (&error);
@@ -55,20 +54,22 @@
   reply = dbus_message_new_method_return (message);
   if (reply == NULL)
     die ("No memory\n");
-
-  dbus_message_append_iter_init (message, &iter);
   
-  if (!dbus_message_iter_append_string (&iter, s))
+  if (!dbus_message_append_args (reply,
+                                 DBUS_TYPE_STRING, s,
+                                 DBUS_TYPE_INVALID))
     die ("No memory");
-
+  
   if (!dbus_connection_send (connection, reply, NULL))
     die ("No memory\n");
+
+  fprintf (stderr, "Echo service echoed string: \"%s\"\n", s);
   
   dbus_free (s);
   
   dbus_message_unref (reply);
     
-  return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+  return DBUS_HANDLER_RESULT_HANDLED;
 }
 
 static DBusHandlerResult