Resource id allocation on server side

Fiedler, Mathias Mathias.Fiedler at xse.de
Tue Jul 17 04:52:02 PDT 2012


Hi,

I'm facing an issue when the client tries to create a new object with an id bigger than the current maximum id on server-side +1. Is it correct that those ids will be silently ignored?
E.g. wl_client_add_resource() would call wl_map_insert_at() return -1 which isn't checked.

For example, this situation might happen when a client calls wl_seat.get_pointer() on a seat which has no pointer device assigned.
The result is that all the following object creations will silently fail. The client won't realize its failure until he tries to call a method on such object. Such error might be hard to find.

Is my analysis correct, or did i miss something? If not what would be a correct fix for this?

Restricting the id allocation to the next higher id seems reasonable, so the compositor get in trouble at corrupt messages with a new id that are too big.
But should this restriction in wayland-server be relaxed?
Or shall the compositor keep track of current maximum id and allocate new ids even when the corresponding server-side resource is not created?

Regards,
Mathias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20120717/b4f776c5/attachment-0001.html>


More information about the wayland-devel mailing list