|
|
@ -84,19 +84,18 @@ static int pidf_generate_body_content(void *body, void *data)
|
|
|
|
|
|
|
|
|
|
|
|
static void pidf_to_string(void *body, struct ast_str **str)
|
|
|
|
static void pidf_to_string(void *body, struct ast_str **str)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int size;
|
|
|
|
|
|
|
|
int growths = 0;
|
|
|
|
|
|
|
|
pjpidf_pres *pres = body;
|
|
|
|
pjpidf_pres *pres = body;
|
|
|
|
|
|
|
|
int growths = 0;
|
|
|
|
|
|
|
|
int size;
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
size = pjpidf_print(pres, ast_str_buffer(*str), ast_str_size(*str) - 1);
|
|
|
|
size = pjpidf_print(pres, ast_str_buffer(*str), ast_str_size(*str) - 1);
|
|
|
|
if (size == AST_PJSIP_XML_PROLOG_LEN) {
|
|
|
|
if (size <= AST_PJSIP_XML_PROLOG_LEN) {
|
|
|
|
ast_str_make_space(str, ast_str_size(*str) * 2);
|
|
|
|
ast_str_make_space(str, ast_str_size(*str) * 2);
|
|
|
|
++growths;
|
|
|
|
++growths;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (size == AST_PJSIP_XML_PROLOG_LEN && growths < MAX_STRING_GROWTHS);
|
|
|
|
} while (size <= AST_PJSIP_XML_PROLOG_LEN && growths < MAX_STRING_GROWTHS);
|
|
|
|
|
|
|
|
if (size <= AST_PJSIP_XML_PROLOG_LEN) {
|
|
|
|
if (size == AST_PJSIP_XML_PROLOG_LEN) {
|
|
|
|
|
|
|
|
ast_log(LOG_WARNING, "PIDF body text too large\n");
|
|
|
|
ast_log(LOG_WARNING, "PIDF body text too large\n");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|