" </interface>"
"</node>";
+#define UAM_ASYNC_REQUEST_TIMEOUT 10 /* 10 sec */
+
static void __uam_manager_copy_params(
GVariant *in_param, void *value, int size)
{
return FALSE;
}
+static gboolean __uam_request_context_timeout_cb(gpointer p)
+{
+ FUNC_ENTRY;
+
+ uam_request_context_t *info = p;
+ retv_if(info == NULL, G_SOURCE_REMOVE);
+
+ /* Remove unhandled async-request */
+ _uam_manager_remove_req_ctxt_from_list(info);
+
+ FUNC_EXIT;
+ return G_SOURCE_REMOVE;
+}
+
static void __uam_manager_save_request_context(
GDBusMethodInvocation *context, int result,
char *sender, int function, gpointer data)
info->data = data;
request_list = g_slist_append(request_list, info);
+ info->tid = _uam_add_timer_full(TIMER_RES_SEC, G_PRIORITY_DEFAULT,
+ UAM_ASYNC_REQUEST_TIMEOUT, __uam_request_context_timeout_cb, info, NULL);
+
FUNC_EXIT;
}
void _uam_manager_remove_req_ctxt_from_list(uam_request_context_t *req_info)
{
FUNC_ENTRY;
- GSList *l;
ret_if(NULL == req_info);
ret_if(NULL == req_info->sender);
- for (l = request_list; NULL != l; l = g_slist_next(l)) {
+ GSList *l = request_list;
+ while (l) {
+
+ GSList *next = l->next;
uam_request_context_t *info = l->data;
+
if (NULL == info || NULL == info->sender)
continue;
if ((strcasecmp(info->sender, req_info->sender) == 0) &&
- req_info->function == info->function) {
- request_list = g_slist_remove(request_list, req_info);
+ req_info->function == info->function) {
+
g_free(req_info->sender);
g_free(req_info);
+
+ request_list = g_slist_remove_link(request_list, l);
+
break;
}
+ l = next;
}
+
FUNC_EXIT;
}