mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: handle recv of 0 bytes
0 bytes from recv means EOS and we can disconnect the client instead of looping forever.
This commit is contained in:
		
							parent
							
								
									0e34c552e9
								
							
						
					
					
						commit
						af41e3423d
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -4656,7 +4656,11 @@ static int do_read(struct client *client)
 | 
			
		|||
		size = client->message->length - idx;
 | 
			
		||||
	}
 | 
			
		||||
	while (true) {
 | 
			
		||||
		if ((r = recv(client->source->fd, data, size, MSG_DONTWAIT)) < 0) {
 | 
			
		||||
		r = recv(client->source->fd, data, size, MSG_DONTWAIT);
 | 
			
		||||
		if (r == 0 && size != 0) {
 | 
			
		||||
			res = -EPIPE;
 | 
			
		||||
			goto exit;
 | 
			
		||||
		} else if (r < 0) {
 | 
			
		||||
			if (errno == EINTR)
 | 
			
		||||
		                continue;
 | 
			
		||||
			res = -errno;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue