mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Merge str_substitution branch.
This branch adds additional methods to dialplan functions, whereby the result buffers are now dynamic buffers, which can be expanded to the size of any result. No longer are variable substitutions limited to 4095 bytes of data. In addition, the common case of needing buffers much smaller than that will enable substitution to only take up the amount of memory actually needed. The existing variable substitution routines are still available, but users of those API calls should transition to using the dynamic-buffer APIs. Reviewboard: http://reviewboard.digium.com/r/174/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -109,17 +109,6 @@ int __ast_str_helper(struct ast_str **buf, size_t max_len, | ||||
| 	return res; | ||||
| } | ||||
|  | ||||
| void ast_str_substitute_variables(struct ast_str **buf, size_t maxlen, struct ast_channel *chan, const char *template) | ||||
| { | ||||
| 	int first = 1; | ||||
| 	do { | ||||
| 		ast_str_make_space(buf, maxlen ? maxlen : | ||||
| 			(first ? strlen(template) * 2 : (*buf)->__AST_STR_LEN * 2)); | ||||
| 		pbx_substitute_variables_helper_full(chan, NULL, template, (*buf)->__AST_STR_STR, (*buf)->__AST_STR_LEN - 1, &((*buf)->__AST_STR_USED)); | ||||
| 		first = 0; | ||||
| 	} while (maxlen == 0 && (*buf)->__AST_STR_LEN - 5 < (*buf)->__AST_STR_USED); | ||||
| } | ||||
|  | ||||
| char *__ast_str_helper2(struct ast_str **buf, size_t maxlen, const char *src, size_t maxsrc, int append, int escapecommas) | ||||
| { | ||||
| 	int dynamic = 0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user