char *stringp, *pair, *key;
int i;
struct ast_variable *var=NULL, *prev=NULL;
- const int EncodeSpecialChars = 1;
+ const int EncodeSpecialChars = 1, bufsize = 64000;
char *buffer;
if (!ast_custom_function_find("CURL")) {
if (!(query = ast_str_create(1000)))
return NULL;
- if (!(buffer = ast_malloc(64000))) {
+ if (!(buffer = ast_malloc(bufsize))) {
ast_free(query);
return NULL;
}
va_end(ap);
ast_str_append(&query, 0, ")}");
- pbx_substitute_variables_helper(NULL, query->str, buffer, sizeof(buffer));
+ pbx_substitute_variables_helper(NULL, query->str, buffer, bufsize);
/* Remove any trailing newline characters */
if ((stringp = strchr(buffer, '\r')) || (stringp = strchr(buffer, '\n')))
char buf1[200], buf2[200];
const char *newparam, *newval;
char *stringp, *line, *pair, *key, *initfield = NULL;
- int i, EncodeSpecialChars = 1;
+ int i;
+ const int EncodeSpecialChars = 1, bufsize = 256000;
struct ast_variable *var=NULL;
struct ast_config *cfg=NULL;
struct ast_category *cat=NULL;
if (!(query = ast_str_create(1000)))
return NULL;
- if (!(buffer = ast_malloc(256000))) {
+ if (!(buffer = ast_malloc(bufsize))) {
ast_free(query);
return NULL;
}
ast_str_append(&query, 0, ")}");
/* Do the CURL query */
- pbx_substitute_variables_helper(NULL, query->str, buffer, sizeof(buffer));
+ pbx_substitute_variables_helper(NULL, query->str, buffer, bufsize);
if (!(cfg = ast_config_new()))
goto exit_multi;
const char *newparam, *newval;
char *stringp;
int i, rowcount = -1;
- const int EncodeSpecialChars = 1;
+ const int EncodeSpecialChars = 1, bufsize = 100;
char *buffer;
if (!ast_custom_function_find("CURL")) {
if (!(query = ast_str_create(1000)))
return -1;
- if (!(buffer = ast_malloc(100))) {
+ if (!(buffer = ast_malloc(bufsize))) {
ast_free(query);
return -1;
}
va_end(ap);
ast_str_append(&query, 0, ")}");
- pbx_substitute_variables_helper(NULL, query->str, buffer, sizeof(buffer));
+ pbx_substitute_variables_helper(NULL, query->str, buffer, bufsize);
/* Line oriented output */
stringp = buffer;
const char *newparam, *newval;
char *stringp;
int i, rowcount = -1;
- const int EncodeSpecialChars = 1;
+ const int EncodeSpecialChars = 1, bufsize = 100;
char *buffer;
if (!ast_custom_function_find("CURL")) {
if (!(query = ast_str_create(1000)))
return -1;
- if (!(buffer = ast_malloc(100))) {
+ if (!(buffer = ast_malloc(bufsize))) {
ast_free(query);
return -1;
}
va_end(ap);
ast_str_append(&query, 0, ")}");
- pbx_substitute_variables_helper(NULL, query->str, buffer, sizeof(buffer));
+ pbx_substitute_variables_helper(NULL, query->str, buffer, bufsize);
stringp = buffer;
while (*stringp <= ' ')
const char *newparam, *newval;
char *stringp;
int i, rowcount = -1;
- const int EncodeSpecialChars = 1;
+ const int EncodeSpecialChars = 1, bufsize = 100;
char *buffer;
if (!ast_custom_function_find("CURL")) {
if (!(query = ast_str_create(1000)))
return -1;
- if (!(buffer = ast_malloc(100))) {
+ if (!(buffer = ast_malloc(bufsize))) {
ast_free(query);
return -1;
}
va_end(ap);
ast_str_append(&query, 0, ")}");
- pbx_substitute_variables_helper(NULL, query->str, buffer, sizeof(buffer));
+ pbx_substitute_variables_helper(NULL, query->str, buffer, bufsize);
/* Line oriented output */
stringp = buffer;
struct ast_str *query;
char buf1[200];
char *stringp, *line, *pair, *key;
- int EncodeSpecialChars = 1, last_cat_metric = -1, cat_metric = -1;
+ const int EncodeSpecialChars = 1, bufsize = 256000;
+ int last_cat_metric = -1, cat_metric = -1;
struct ast_category *cat=NULL;
char *buffer, *cur_cat = "";
char *category = "", *var_name = "", *var_val = "";
if (!(query = ast_str_create(1000)))
return NULL;
- if (!(buffer = ast_malloc(256000))) {
+ if (!(buffer = ast_malloc(bufsize))) {
ast_free(query);
return NULL;
}
ast_str_set(&query, 0, "${CURL(%s/static?file=%s)}", url, buf1);
/* Do the CURL query */
- pbx_substitute_variables_helper(NULL, query->str, buffer, sizeof(buffer));
+ pbx_substitute_variables_helper(NULL, query->str, buffer, bufsize);
/* Line oriented output */
stringp = buffer;