summaryrefslogtreecommitdiff
path: root/libdleyna
diff options
context:
space:
mode:
authorLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-08-27 18:14:42 +0200
committerLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-09-02 15:24:26 +0200
commit96f4729081606d859a5dff1aaab75511c02829b8 (patch)
treec9033e88b54875ceb2267220a9553262e0166294 /libdleyna
parent1cd87320915cab71e89c547ef50a9043bac5768b (diff)
downloaddleyna-server-96f4729081606d859a5dff1aaab75511c02829b8.tar.gz
[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 <ludovic.ferrandis@intel.com>
Diffstat (limited to 'libdleyna')
-rw-r--r--libdleyna/server/device.c8
-rw-r--r--libdleyna/server/upnp.c2
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");