mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
server: give more precise error message
There are two same error messages with different cause. Let user know what is the cause of the error. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
c770b84658
commit
e16ee74e47
1 changed files with 6 additions and 5 deletions
|
|
@ -238,7 +238,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
|
||||||
const struct wl_message *message;
|
const struct wl_message *message;
|
||||||
uint32_t p[2];
|
uint32_t p[2];
|
||||||
uint32_t resource_flags;
|
uint32_t resource_flags;
|
||||||
int opcode, size;
|
int opcode, size, since;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (mask & (WL_EVENT_ERROR | WL_EVENT_HANGUP)) {
|
if (mask & (WL_EVENT_ERROR | WL_EVENT_HANGUP)) {
|
||||||
|
|
@ -294,13 +294,14 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
message = &object->interface->methods[opcode];
|
message = &object->interface->methods[opcode];
|
||||||
|
since = wl_message_get_since(message);
|
||||||
if (!(resource_flags & WL_MAP_ENTRY_LEGACY) &&
|
if (!(resource_flags & WL_MAP_ENTRY_LEGACY) &&
|
||||||
resource->version > 0 &&
|
resource->version > 0 && resource->version < since) {
|
||||||
resource->version < wl_message_get_since(message)) {
|
|
||||||
wl_resource_post_error(client->display_resource,
|
wl_resource_post_error(client->display_resource,
|
||||||
WL_DISPLAY_ERROR_INVALID_METHOD,
|
WL_DISPLAY_ERROR_INVALID_METHOD,
|
||||||
"invalid method %d, object %s@%u",
|
"invalid method %d (since %d < %d)"
|
||||||
opcode,
|
", object %s@%u",
|
||||||
|
opcode, resource->version, since,
|
||||||
object->interface->name,
|
object->interface->name,
|
||||||
object->id);
|
object->id);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue