core: send an error when receiving invalid mem

And also print the client error when we get it.
This commit is contained in:
Wim Taymans 2020-04-21 15:57:38 +02:00
parent ee5c3349a0
commit b17ff6e2ad
2 changed files with 2 additions and 1 deletions

View file

@ -106,6 +106,7 @@ static void core_event_add_mem(void *data, uint32_t id, uint32_t type, int fd, u
if (m->id != id) {
pw_log_error(NAME" %p: invalid mem id %u, expected %u",
this, id, m->id);
pw_proxy_errorf(&this->proxy, -EINVAL, "invalid mem id %u, expected %u", id, m->id);
pw_memblock_unref(m);
}
}

View file

@ -202,7 +202,7 @@ static int core_error(void *object, uint32_t id, int seq, int res, const char *m
struct pw_impl_client *client = resource->client;
struct pw_resource *r;
pw_log_debug(NAME" %p: error %d for resource %d: %s", resource->context, res, id, message);
pw_log_error(NAME" %p: error %d for resource %d: %s", resource->context, res, id, message);
if ((r = pw_impl_client_find_resource(client, id)) == NULL)
return -EINVAL;