global: use SPA_ID_INVALID to send serial id

We use the done event to send the object serial to the client. Use an
invalid object id for this and filter it out on the receiver or else
the client might get an unexpected done event.

Fixes #2253
This commit is contained in:
Wim Taymans 2022-03-31 09:37:25 +02:00
parent e8f93c3e1e
commit c6a8f8d3ef
2 changed files with 4 additions and 1 deletions

View file

@ -347,6 +347,9 @@ static int core_event_demarshal_done(void *object, const struct pw_protocol_nati
SPA_POD_Int(&seq)) < 0)
return -EINVAL;
if (id == SPA_ID_INVALID)
return 0;
return pw_proxy_notify(proxy, struct pw_core_events, done, 0, id, seq);
}

View file

@ -177,7 +177,7 @@ int pw_global_register(struct pw_global *global)
pw_log_debug("impl-client %p: (no registry) global %d %08x serial:%"PRIu64
" generation:%"PRIu64, client, global->id, permissions, global->serial,
global->generation);
pw_core_resource_done(client->core_resource, global->id, 0);
pw_core_resource_done(client->core_resource, SPA_ID_INVALID, 0);
}
}