dbus/glib dbus-gvalue.c,1.9,1.10 dbus-gobject.c,1.23,1.24

Colin Walters walters at freedesktop.org
Mon Jun 13 08:36:33 PDT 2005


Update of /cvs/dbus/dbus/glib
In directory gabe:/tmp/cvs-serv24169/glib

Modified Files:
	dbus-gvalue.c dbus-gobject.c 
Log Message:
2005-06-13  Ross Burton <ross at burtonini.com>.

	* glib/dbus-gobject.c: Handle errors on message
	demarshalling by sending error message back.
	* glib/dbus-gvalue.c: Initialize return variables.


Index: dbus-gvalue.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gvalue.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- dbus-gvalue.c	13 Jun 2005 03:01:24 -0000	1.9
+++ dbus-gvalue.c	13 Jun 2005 15:36:31 -0000	1.10
@@ -1300,7 +1300,7 @@
   DBusMessageIter subiter;
   char **array;
   char **elt;
-  gboolean ret;
+  gboolean ret = FALSE;
 
   g_assert (G_VALUE_TYPE (value) == g_strv_get_type ());
 
@@ -1336,7 +1336,7 @@
   GArray *array;
   guint elt_size;
   const char *subsignature_str;
-  gboolean ret;
+  gboolean ret = FALSE;
 
   elt_gtype = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value));
   /* FIXME - this means we can't send an array of DBusGValue right now... */
@@ -1417,7 +1417,7 @@
   DBusMessageIter subiter;
   GPtrArray *array;
   const char *subsignature_str;
-  gboolean ret;
+  gboolean ret = FALSE;
   guint i;
 
   subsignature_str = dbus_gtype_to_signature (DBUS_TYPE_G_PROXY);
@@ -1553,7 +1553,7 @@
   DBusMessageIter subiter;
   char *variant_sig;
   GValue *real_value;
-  gboolean ret;
+  gboolean ret = FALSE;
 
   real_value = g_value_get_boxed (value);
   value_gtype = G_VALUE_TYPE (real_value);

Index: dbus-gobject.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gobject.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- dbus-gobject.c	13 Jun 2005 03:01:24 -0000	1.23
+++ dbus-gobject.c	13 Jun 2005 15:36:31 -0000	1.24
@@ -772,7 +772,8 @@
     guint n_params;
     const GType *types;
     DBusGValueMarshalCtx context;
-
+    GError *error = NULL;
+    
     context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (connection);
     context.proxy = NULL;
 
@@ -780,12 +781,16 @@
     n_params = types_array->len;
     types = (const GType*) types_array->data;
 
-    value_array = dbus_gvalue_demarshal_message (&context, message, n_params, types, NULL);
+    value_array = dbus_gvalue_demarshal_message (&context, message, n_params, types, &error);
     if (value_array == NULL)
       {
 	g_free (in_signature); 
 	g_array_free (types_array, TRUE);
-	return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+	reply = dbus_message_new_error (message, "org.freedesktop.DBus.GLib.ErrorError", error->message);
+	dbus_connection_send (connection, reply, NULL);
+	dbus_message_unref (reply);
+	g_error_free (error);
+	return DBUS_HANDLER_RESULT_HANDLED;
       }
     g_array_free (types_array, TRUE);
   }



More information about the dbus-commit mailing list