Enlightenment CVS committal Author : sebastid Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_dbus Modified Files: ecore_dbus.c ecore_dbus_message.c ecore_dbus_private.h Log Message: Store methods until we have the reply. Alloc the correct amount of mem. =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_dbus/ecore_dbus.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ecore_dbus.c 27 Jul 2006 13:29:43 -0000 1.18 +++ ecore_dbus.c 27 Jul 2006 14:06:04 -0000 1.19 @@ -159,8 +159,8 @@ svr->cnt_msg = 0; svr->auth_type = -1; svr->auth_type_transaction = 0; - svr->methods = ecore_hash_new(ecore_direct_hash, ecore_direct_compare); - ecore_hash_set_free_value(svr->methods, free); + svr->messages = ecore_hash_new(ecore_direct_hash, ecore_direct_compare); + ecore_hash_set_free_value(svr->messages, ECORE_FREE_CB(_ecore_dbus_message_free)); servers = _ecore_list2_append(servers, svr); return svr; @@ -172,7 +172,7 @@ if (svr->server) ecore_con_server_del(svr->server); servers = _ecore_list2_remove(servers, svr); if (svr->unique_name) free(svr->unique_name); - ecore_hash_destroy(svr->methods); + ecore_hash_destroy(svr->messages); free(svr); } @@ -364,13 +364,13 @@ /* Trap known messages */ if (msg->type == ECORE_DBUS_MESSAGE_TYPE_METHOD_RETURN) { - //char *method; unsigned int *serial; serial = ecore_dbus_message_header_field_get(msg, ECORE_DBUS_HEADER_FIELD_REPLY_SERIAL); - //method = ecore_hash_remove(svr->methods, (void *)(ev->header.reply_serial)); if (serial) { + Ecore_DBus_Message *sent; + sent = ecore_hash_remove(svr->messages, (void *)(*serial)); if (*serial == svr->hello) { Ecore_DBus_Event_Server_Add *svr_add; @@ -398,6 +398,7 @@ ecore_event_add(ECORE_DBUS_EVENT_SERVER_METHOD_RETURN, ev2, _ecore_dbus_event_server_data_free, NULL); } + _ecore_dbus_message_free(sent); } else { @@ -477,7 +478,7 @@ Ecore_DBus_Message_Field *f; int i = 0; - ev->args = malloc(ecore_list_nodes(msg->fields) * sizeof(Ecore_DBus_Event_Arg *)); + ev->args = malloc(ecore_list_nodes(msg->fields) * sizeof(Ecore_DBus_Event_Arg)); ecore_list_goto_first(msg->fields); while ((f = ecore_list_next(msg->fields))) { =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_dbus/ecore_dbus_message.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ecore_dbus_message.c 27 Jul 2006 13:29:44 -0000 1.5 +++ ecore_dbus_message.c 27 Jul 2006 14:06:04 -0000 1.6 @@ -21,7 +21,7 @@ char *path, char *interface, char *method, char *fmt, ...) { - unsigned int serial, body_start; + unsigned int body_start; char buf[1024]; Ecore_DBus_Message_Field_Array *arr; @@ -147,11 +147,9 @@ snprintf(buf, sizeof(buf), "%s.%s", interface, method); else strcpy(buf, method); - ecore_hash_set(svr->methods, (void *)msg->serial, strdup(buf)); + ecore_hash_set(svr->messages, (void *)msg->serial, msg); - serial = msg->serial; - _ecore_dbus_message_free(msg); - return serial; + return msg->serial; } EAPI void =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_dbus/ecore_dbus_private.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ecore_dbus_private.h 27 Jul 2006 13:29:44 -0000 1.9 +++ ecore_dbus_private.h 27 Jul 2006 14:06:04 -0000 1.10 @@ -63,7 +63,7 @@ int auth_type_transaction; int cnt_msg; - Ecore_Hash *methods; + Ecore_Hash *messages; unsigned int hello; char *unique_name; }; ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs