mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: more specific error message when too many connections
This appears to be encountered often enough so a clearer message is maybe useful.
This commit is contained in:
		
							parent
							
								
									d67882fa10
								
							
						
					
					
						commit
						8d019c5689
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -356,6 +356,7 @@ on_connect(void *data, int fd, uint32_t mask)
 | 
				
			||||||
	int client_fd, val;
 | 
						int client_fd, val;
 | 
				
			||||||
	struct client *client = NULL;
 | 
						struct client *client = NULL;
 | 
				
			||||||
	const char *client_access = NULL;
 | 
						const char *client_access = NULL;
 | 
				
			||||||
 | 
						const char *error_reason = NULL;
 | 
				
			||||||
	pid_t pid;
 | 
						pid_t pid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	length = sizeof(name);
 | 
						length = sizeof(name);
 | 
				
			||||||
| 
						 | 
					@ -374,6 +375,7 @@ on_connect(void *data, int fd, uint32_t mask)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (server->n_clients >= server->max_clients) {
 | 
						if (server->n_clients >= server->max_clients) {
 | 
				
			||||||
		close(client_fd);
 | 
							close(client_fd);
 | 
				
			||||||
 | 
							error_reason = "too many client application connections";
 | 
				
			||||||
		errno = ECONNREFUSED;
 | 
							errno = ECONNREFUSED;
 | 
				
			||||||
		goto error;
 | 
							goto error;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -487,7 +489,9 @@ on_connect(void *data, int fd, uint32_t mask)
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
error:
 | 
					error:
 | 
				
			||||||
	pw_log_error("server %p: failed to create client: %m", server);
 | 
						pw_log_error("server %p: %s: %m", server,
 | 
				
			||||||
 | 
								error_reason ? error_reason : "failed to create client");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (client)
 | 
						if (client)
 | 
				
			||||||
		client_free(client);
 | 
							client_free(client);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue