mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	return ENOENT for unknown resources
Fix some other errors as well, ENOSYS for invalid interface, ENOTSUP for unimplemented methods.
This commit is contained in:
		
							parent
							
								
									12d831fc39
								
							
						
					
					
						commit
						387009e0d6
					
				
					 4 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -204,19 +204,19 @@ process_messages(struct client_data *data)
 | 
			
		|||
		resource = pw_impl_client_find_resource(client, msg->id);
 | 
			
		||||
		if (resource == NULL) {
 | 
			
		||||
			pw_resource_errorf(client->core_resource,
 | 
			
		||||
					-EINVAL, "unknown resource %u op:%u", msg->id, msg->opcode);
 | 
			
		||||
					-ENOENT, "unknown resource %u op:%u", msg->id, msg->opcode);
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		marshal = pw_resource_get_marshal(resource);
 | 
			
		||||
		if (marshal == NULL || msg->opcode >= marshal->n_client_methods) {
 | 
			
		||||
			res = -EINVAL;
 | 
			
		||||
			res = -ENOSYS;
 | 
			
		||||
			goto invalid_method;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		demarshal = marshal->server_demarshal;
 | 
			
		||||
		if (!demarshal[msg->opcode].func) {
 | 
			
		||||
			res = -ENOENT;
 | 
			
		||||
			res = -ENOTSUP;
 | 
			
		||||
			goto invalid_message;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue