mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pw-dot: truncate escaped string values to 128
This avoids objects in the graph being too big if one of their properties has a long value (Eg 'pipewire.sec.label' in the client objects).
This commit is contained in:
		
							parent
							
								
									d933984ee6
								
							
						
					
					
						commit
						20de0ab96a
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -22,6 +22,7 @@
 | 
				
			||||||
#define GLOBAL_ID_NONE UINT32_MAX
 | 
					#define GLOBAL_ID_NONE UINT32_MAX
 | 
				
			||||||
#define DEFAULT_DOT_PATH "pw.dot"
 | 
					#define DEFAULT_DOT_PATH "pw.dot"
 | 
				
			||||||
#define DEFAULT_DOT_DATA_SIZE 2048
 | 
					#define DEFAULT_DOT_DATA_SIZE 2048
 | 
				
			||||||
 | 
					#define MAX_ESCAPED_LEN 128
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct global;
 | 
					struct global;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -140,6 +141,12 @@ static int escape_quotes(char *str, int size, const char *val)
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		val++;
 | 
							val++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/* Truncate with "..." if string has more than escaped len characters. */
 | 
				
			||||||
 | 
							if (len >= MAX_ESCAPED_LEN) {
 | 
				
			||||||
 | 
								__PUT('.'); __PUT('.'); __PUT('.');
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	__PUT('\0');
 | 
						__PUT('\0');
 | 
				
			||||||
#undef __PUT
 | 
					#undef __PUT
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue