mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -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;
 | 
			
		||||
	uint32_t p[2];
 | 
			
		||||
	uint32_t resource_flags;
 | 
			
		||||
	int opcode, size;
 | 
			
		||||
	int opcode, size, since;
 | 
			
		||||
	int len;
 | 
			
		||||
 | 
			
		||||
	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];
 | 
			
		||||
		since = wl_message_get_since(message);
 | 
			
		||||
		if (!(resource_flags & WL_MAP_ENTRY_LEGACY) &&
 | 
			
		||||
		    resource->version > 0 &&
 | 
			
		||||
		    resource->version < wl_message_get_since(message)) {
 | 
			
		||||
		    resource->version > 0 && resource->version < since) {
 | 
			
		||||
			wl_resource_post_error(client->display_resource,
 | 
			
		||||
					       WL_DISPLAY_ERROR_INVALID_METHOD,
 | 
			
		||||
					       "invalid method %d, object %s@%u",
 | 
			
		||||
					       opcode,
 | 
			
		||||
					       "invalid method %d (since %d < %d)"
 | 
			
		||||
					       ", object %s@%u",
 | 
			
		||||
					       opcode, resource->version, since,
 | 
			
		||||
					       object->interface->name,
 | 
			
		||||
					       object->id);
 | 
			
		||||
			break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue