MsgPortDbusService *dbus_service = NULL;
msgport_return_val_if_fail (dbus_mgr && MSGPORT_IS_DBUS_MANAGER (dbus_mgr), FALSE);
- DBG ("register service request from %p for port %s", dbus_mgr, port_name);
+ DBG ("register service request from %p('%s') for port '%s', is_trusted: %d",
+ dbus_mgr, dbus_mgr->priv->app_id, port_name, is_trusted);
dbus_service = msgport_manager_register_service (
dbus_mgr->priv->manager, dbus_mgr,
msgport_return_val_if_fail (dbus_mgr && MSGPORT_IS_DBUS_MANAGER (dbus_mgr), FALSE);
- DBG ("check remote service request from %p for %s %s %d",
+ DBG ("check remote service request from %p for '%s' '%s', is_trusted: %d",
dbus_mgr, remote_app_id, remote_port_name, is_trusted);
remote_dbus_manager = msgport_dbus_server_get_dbus_manager_by_app_id (
msgport_return_val_if_fail (dbus_mgr && MSGPORT_IS_DBUS_MANAGER (dbus_mgr), FALSE);
- DBG ("send_message from %p : %d ", dbus_mgr, service_id);
+ DBG ("send_message from %p('%s') to service_id %d",
+ dbus_mgr, dbus_mgr->priv->app_id, service_id);
peer_dbus_service = msgport_manager_get_service_by_id (
dbus_mgr->priv->manager, service_id, &error);
return FALSE;
}
- DBG ("Sending message to %p from '%s:%s'", dbus_service, r_app_id, r_port);
+ DBG ("Sending message to %p from ('%s':'%s':%d)", dbus_service, r_app_id, r_port, r_is_trusted);
msgport_dbus_glue_service_emit_on_message (dbus_service->priv->dbus_skeleton, data, r_app_id, r_port, r_is_trusted);
return TRUE;
gboolean is_trusted)
{
GList *service_list = g_hash_table_lookup (manager->priv->owner_service_map, owner);
+
+ DBG ("Checking for port '%s', is_tursted : %d owned by : %p('%s')",
+ port_name, is_trusted, owner, msgport_dbus_manager_get_app_id (owner));
+
while (service_list != NULL) {
MsgPortDbusService *dbus_service = MSGPORT_DBUS_SERVICE (service_list->data);
- DBG ("Owner : %p - Port : %s, Is_trusted : %d", owner,
- msgport_dbus_service_get_port_name (dbus_service),
- msgport_dbus_service_get_is_trusted (dbus_service));
-
if ( !g_strcmp0 (port_name, msgport_dbus_service_get_port_name (dbus_service)) &&
is_trusted == msgport_dbus_service_get_is_trusted (dbus_service)) {
+ DBG (" Found with %d", msgport_dbus_service_get_id (dbus_service));
return dbus_service ;
}
service_list = service_list->next;
}
+ DBG (" Not Found");
+
return NULL;
}
/* create new port/service */
dbus_service = msgport_dbus_service_new (owner, port_name, is_trusted, error);
if (!dbus_service) {
+ ERR ("Failed to create new servcie");
return NULL;
}
/* cache newly created service */
return TRUE;
}
-
#include "msgport-factory.h"
#include "msgport-manager.h"
+#include "common/log.h"
#include <glib.h>
-GHashTable *__managers ; /* GThread:MsgPortManager */
+GHashTable *__managers = NULL; /* GThread:MsgPortManager */
G_LOCK_DEFINE(managers);
static
return manager;
}
-
{
#ifdef ENABLE_DEBUG
gchar *str_data = g_variant_print (data, TRUE);
- DBG ("Message received : %s(%"G_GSIZE_FORMAT")", str_data, g_variant_n_children (data));
+ DBG ("Message received : '%s' from '%s':'%s':%d",
+ str_data, remote_app_id, remote_port, remote_is_trusted);
g_free (str_data);
#endif
bundle *b = bundle_from_variant_map (data);
+ /*
+ * NOTE: wrt plugin cannot handle empty strings for port_id and app_id.
+ * It is expecting NULL in this case, But we get empty stirng from Dbus.
+ * So check for this case:
+ */
+ if (remote_app_id && !remote_app_id[0]) remote_app_id = NULL;
+ if (remote_port && !remote_port[0]) remote_port = NULL;
+
service->client_cb (msgport_dbus_glue_service_get_id (service->proxy), remote_app_id, remote_port, remote_is_trusted, b);
bundle_free (b);
return MESSAGEPORT_ERROR_NONE;
}
-