From 96f4729081606d859a5dff1aaab75511c02829b8 Mon Sep 17 00:00:00 2001 From: Ludovic Ferrandis Date: Tue, 27 Aug 2013 18:14:42 +0200 Subject: [Filtering] Use generic filtering for GetAll Task GetAll has a field member 'filter_mask'. This task and field are used by other methods, but not by GetAll properties. GetAll parsing function used directly DLS_UPNP_MASK_ALL_PROPS constant in the code. This will prevent to reuse the GetAll parsing function with another filter mask. Initialize filter_mask to DLS_UPNP_MASK_ALL_PROPS in GetAll method and use filter_mask in the GetAll parsing function. Signed-off-by: Ludovic Ferrandis --- libdleyna/server/device.c | 8 ++++---- libdleyna/server/upnp.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libdleyna/server/device.c b/libdleyna/server/device.c index fdcaa2d..678c88e 100644 --- a/libdleyna/server/device.c +++ b/libdleyna/server/device.c @@ -1401,7 +1401,7 @@ static void prv_get_item(GUPnPDIDLLiteParser *parser, if (!GUPNP_IS_DIDL_LITE_CONTAINER(object)) dls_props_add_item(cb_task_data->vb, object, cb_data->task.target.root_path, - DLS_UPNP_MASK_ALL_PROPS, + cb_task_data->filter_mask, cb_task_data->protocol_info); else cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, @@ -1461,7 +1461,7 @@ static void prv_get_object(GUPnPDIDLLiteParser *parser, if (!dls_props_add_object(cb_task_data->vb, object, cb_data->task.target.root_path, - parent_path, DLS_UPNP_MASK_ALL_PROPS)) + parent_path, cb_task_data->filter_mask)) goto on_error; g_free(path); @@ -1491,7 +1491,7 @@ static void prv_get_all(GUPnPDIDLLiteParser *parser, dls_props_add_container( cb_task_data->vb, (GUPnPDIDLLiteContainer *) - object, DLS_UPNP_MASK_ALL_PROPS, + object, cb_task_data->filter_mask, cb_task_data->protocol_info, &have_child_count); if (!have_child_count) @@ -1500,7 +1500,7 @@ static void prv_get_all(GUPnPDIDLLiteParser *parser, dls_props_add_item(cb_task_data->vb, object, cb_data->task.target.root_path, - DLS_UPNP_MASK_ALL_PROPS, + cb_task_data->filter_mask, cb_task_data->protocol_info); } } diff --git a/libdleyna/server/upnp.c b/libdleyna/server/upnp.c index dc2ff12..2cbef81 100644 --- a/libdleyna/server/upnp.c +++ b/libdleyna/server/upnp.c @@ -514,7 +514,7 @@ void dls_upnp_get_all_props(dls_upnp_t *upnp, dls_client_t *client, DLEYNA_LOG_DEBUG("Root Object = %d", root_object); cb_task_data->protocol_info = client->protocol_info; - + cb_task_data->filter_mask = DLS_UPNP_MASK_ALL_PROPS; dls_device_get_all_props(client, task, root_object); DLEYNA_LOG_DEBUG("Exit with SUCCESS"); -- cgit v1.2.1