Re: Two quick questions about the new whitelist functionality



Hi Jens,

On 08/28/2013 01:48 PM, Jens Georg wrote:

[ ... ]

I could be reading the code wrong here, but it seems that
on_context_unavailable will do an unnecessary rescan on the control
points for networks A and B.  This control points are already active so
the rescan isn't necessary.  Also, if we set a control point to active
is there any need to invoke a rescan?  Doesn't the effect of
transitioning from non-active to active send out all the broadcast
messages?  So I was wondering if we could we just remove the call to
gssdp_resource_browser_rescan or is this needed for some reason?

The initial idea was to not think about signalling previously
black-listed contexts, just throw them away and let rescan do the dirty
work. Maybe that's too much of network activity, though.


Arrgh, I mentioned the wrong function name in my previous email! For on_context_unavailable read gupnp_context_manager_filter_context. Sorry for the confusion.

This second question is about previously white listed contexts that are still white listed after the whitelist is updated. Look at the following code snippet taken from gupnp_context_manager_filter_context, which is called when our white list is updated, enabled or disabled.


                if (check) {
                        /* Filter out context */
context = gupnp_control_point_get_context (obj->data);
                        match = gupnp_white_list_check_context (white_list,
                                                                context);
                } else {
                        /* Re-activate all context, if needed */
                        match = TRUE;
                }

                browser = GSSDP_RESOURCE_BROWSER (obj->data);
                gssdp_resource_browser_set_active (browser, match);

                if (match)
                        (void) gssdp_resource_browser_rescan (browser);


match is set to true if the whitelist is disabled or empty or the control point (browser) being examined belongs to a context in the whitelist.

If match is true and browser is enabled, we call gssdp_resource_browser_set_active which does nothing and gssdp_resource_browser_rescan (browser) which is unnecessary as far as I can tell, as the control point is already active.

If match is true and the browser is disabled we call gssdp_resource_browser_set_active which should send out all the search messages and then gssdp_resource_browser_rescan which does the same thing.

If match is false we don't call gssdp_resource_browser_rescan. So I can't see any reason to call gssdp_resource_browser_rescan in this piece of code, unless gssdp_resource_browser_set_active doesn't do what I think it does.

Regards,

Mark





_______________________________________________
gupnp-list mailing list
gupnp-list gnome org
https://mail.gnome.org/mailman/listinfo/gupnp-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]