Exemple #1
0
void dleyna_service_task_cancel_cb(dleyna_task_atom_t *atom, gpointer user_data)
{
	dleyna_service_task_t *task = (dleyna_service_task_t *)atom;

	if (task->p_action) {
		if (task->proxy)
			gupnp_service_proxy_cancel_action(task->proxy,
							  task->p_action);
		task->p_action = NULL;

		dleyna_task_queue_task_completed(task->base.queue_id);
	}
}
Exemple #2
0
void dls_async_task_cancelled_cb(GCancellable *cancellable, gpointer user_data)
{
	dls_async_task_t *cb_data = user_data;

	if (cb_data->proxy != NULL)
		gupnp_service_proxy_cancel_action(cb_data->proxy,
						  cb_data->action);

	if (!cb_data->error)
		cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
					     DLEYNA_ERROR_CANCELLED,
					     "Operation cancelled.");
	(void) g_idle_add(dls_async_task_complete, cb_data);
}
static void
free_proxy (struct Proxy *prox)
{
    if (prox->external_ip_action)
        gupnp_service_proxy_cancel_action (prox->proxy, prox->external_ip_action);

    gupnp_service_proxy_remove_notify (prox->proxy, "ExternalIPAddress",
                                       _external_ip_address_changed, prox);

    g_ptr_array_foreach (prox->proxymappings, (GFunc) free_proxymapping, NULL);
    g_ptr_array_free (prox->proxymappings, TRUE);
    g_free (prox->external_ip);
    g_slice_free (struct Proxy, prox);
}
static void
stop_proxymapping (struct ProxyMapping *pm, gboolean stop_renew)
{
    if (pm->action)
        gupnp_service_proxy_cancel_action (pm->proxy->proxy,
                                           pm->action);
    pm->action = NULL;

    if (stop_renew && pm->renew_src)
    {
        g_source_destroy (pm->renew_src);
        g_source_unref (pm->renew_src);
        pm->renew_src = NULL;
    }
}