From: Enlightenment S. <no-...@en...> - 2012-05-14 14:38:50
|
Log: clouseau: Removed packet-size limit Signed-off-by: Aharon Hillel <a.h...@pa...> Author: tasn Date: 2012-05-14 07:38:39 -0700 (Mon, 14 May 2012) New Revision: 71021 Trac: http://trac.enlightenment.org/e/changeset/71021 Modified: trunk/clouseau/src/lib/client.c trunk/clouseau/src/lib/clouseaud.c trunk/clouseau/src/lib/libclouseau.c Modified: trunk/clouseau/src/lib/client.c =================================================================== --- trunk/clouseau/src/lib/client.c 2012-05-14 14:38:35 UTC (rev 71020) +++ trunk/clouseau/src/lib/client.c 2012-05-14 14:38:39 UTC (rev 71021) @@ -30,6 +30,8 @@ char *msg="Hello send from GUI client"; int size = 0; + ecore_ipc_server_data_size_max_set(ev->server, -1); + data_desc *td = _data_descriptors_init(); ack_st t = { msg }; Variant_st *v = variant_alloc(APP_ACK, sizeof(t), &t); @@ -390,6 +392,8 @@ return NULL; } + ecore_ipc_server_data_size_max_set(svr, -1); + /* set event handler for server connect */ ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_add, NULL); /* set event handler for server disconnect */ @@ -729,9 +733,6 @@ elm_shutdown(); printf("Client cleanup.\n"); - ecore_ipc_shutdown(); - ecore_shutdown(); - eina_shutdown(); return 0; } ELM_MAIN() Modified: trunk/clouseau/src/lib/clouseaud.c =================================================================== --- trunk/clouseau/src/lib/clouseaud.c 2012-05-14 14:38:35 UTC (rev 71020) +++ trunk/clouseau/src/lib/clouseaud.c 2012-05-14 14:38:39 UTC (rev 71021) @@ -27,6 +27,7 @@ struct _tree_info_st { + void *app; /* app ptr to identify where the data came from */ void *data; size_t size; }; @@ -132,6 +133,8 @@ char *msg="hello! - sent from the server"; int size = 0; + ecore_ipc_client_data_size_max_set(ev->client, -1); + data_desc *td = _data_descriptors_init(); ack_st t = { msg }; Variant_st *v = variant_alloc(DAEMON_ACK, sizeof(t), &t); @@ -239,72 +242,17 @@ break; case APP_TREE_DATA: - log_message(LOG_FILE, "a", "Got tree-data from APP"); + { + char m[1024]; + sprintf(m, "Got tree-data from APP <%p>", ev->client); + log_message(LOG_FILE, "a", m); + } break; } } else log_message(LOG_FILE, "a", "Failed to decode data."); - -/* - test_st *t = test_st_new(GUI, TSUITE_EVENT_ACK, msg); - p = eet_data_descriptor_encode(td, t, &size); - - ecore_ipc_client_send(ev->client, 0,0,0,0,EINA_FALSE, p, size); - ecore_ipc_client_flush(ev->client); - free(p); - free(t); -*/ - -#if 0 - char fmt[128]; - struct _Client *client = ecore_ipc_client_data_get(ev->client); - Variant_st *pkt = get_packet_data(ev->data, ev->size); - - snprintf(fmt, sizeof(fmt), "%s %d pkt->client=<%d> pkt->type=<%d>", __func__, __LINE__, pkt->client, pkt->type); - log_message(LOG_FILE, "a", fmt); - snprintf(fmt, sizeof(fmt), - "Received %i bytes from client\n",ev->size); - log_message(LOG_FILE, "a", fmt); - - switch(pkt->client) - { - case APP: /* Get info from app */ - log_message(LOG_FILE, "a", "Message from APP."); - if (pkt->type == TSUITE_EVENT_TREE_ITEM) - { - log_message(LOG_FILE, "a", "Tree info message from APP."); - char txt[1024]; - tree_info_st *tree = malloc(sizeof(*tree)); - tree->data = ev->data; - tree->size = ev->size; - trees = eina_list_append(trees, tree); - sprintf(txt, "Adding Tree (%d)", eina_list_count(trees)); - log_message(LOG_FILE, "a", txt); - } - break; - - case GUI: /* Sent trees to GUI */ - log_message(LOG_FILE, "a", "Message from GUI."); - if (pkt->type == TSUITE_EVENT_TREE_ITEM) - { - log_message(LOG_FILE, "a", "Tree info message from GUI."); - Eina_List *l; - tree_info_st *tree; - EINA_LIST_FOREACH(trees, l, tree) - { /* Send each tree in a packet */ - log_message(LOG_FILE, "a", "Sending Tree"); - ecore_ipc_client_send(ev->client,0,0,0,0,EINA_FALSE,tree->data, tree->size); - ecore_ipc_client_flush(ev->client); - } - - } - break; - } - - client->sdata += ev->size; -#endif return ECORE_CALLBACK_RENEW; } /* END - Ecore communication callbacks */ @@ -324,6 +272,8 @@ if (!(svr = ecore_ipc_server_add(ECORE_IPC_REMOTE_SYSTEM, LOCALHOST, PORT, NULL))) exit(1); + ecore_ipc_server_data_size_max_set(svr, -1); + ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_add, NULL); ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb)_del, NULL); ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb)_data, NULL); Modified: trunk/clouseau/src/lib/libclouseau.c =================================================================== --- trunk/clouseau/src/lib/libclouseau.c 2012-05-14 14:38:35 UTC (rev 71020) +++ trunk/clouseau/src/lib/libclouseau.c 2012-05-14 14:38:39 UTC (rev 71021) @@ -183,6 +183,8 @@ char *msg="hello! - sent from the APP"; int size = 0; + ecore_ipc_server_data_size_max_set(ev->server, -1); + data_desc *td = _data_descriptors_init(); ack_st t = { msg }; Variant_st *v = variant_alloc(APP_ACK, sizeof(t), &t); @@ -297,6 +299,8 @@ return EINA_FALSE; } + ecore_ipc_server_data_size_max_set(svr, -1); + /* set event handler for server connect */ ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_add, NULL); /* set event handler for server disconnect */ |