diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-11 23:35:52 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-11 23:35:52 +0000 |
commit | 6667ff1471910dd60a21ed2358899e1c18113da3 (patch) | |
tree | 12621581b518c952e2f8dc053cb29187c66ca94b | |
parent | 0658d1b33f104a24a5cf8098653faac3dbe7f8c5 (diff) |
Recorded merge of revisions 193756 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r193756 | tilghman | 2009-05-11 17:50:47 -0500 (Mon, 11 May 2009) | 25 lines
Recorded merge of revisions 193755 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r193755 | tilghman | 2009-05-11 17:48:20 -0500 (Mon, 11 May 2009) | 18 lines
Move 300 bytes around on the stack, to make more room for an extension buffer.
This allows more concurrent extensions to be copied for a single voicemail,
without creating a possibility of upsetting existing users, where a dialplan
could run out of stack space where it had run fine before. Alternatively,
we could have allocated off the heap, but that is a larger change and would
have increased the chance for instability introduced by this change.
This is really solved starting in 1.6.0.11, as the use of an ast_str buffer
allows an unlimited number of extensions (up to available memory). We
additionally create a new warning message when the buffer length is exceeded,
permitting administrators to see an issue after the fact, whereas previously
the list was silently truncated.
(closes issue #14739)
Reported by: p_lindheimer
Patches:
20090417__bug14739.diff.txt uploaded by tilghman (license 14)
Tested by: p_lindheimer
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@193822 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_voicemail.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index b658e7e8f..0c18de2ee 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -232,6 +232,8 @@ static AST_LIST_HEAD_STATIC(vmstates, vmstate); #define ERROR_LOCK_PATH -100 +AST_THREADSTORAGE(voicemail_extension_list); + enum { NEW_FOLDER, OLD_FOLDER, @@ -4899,8 +4901,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ char fmt[80]; char *context; char ecodes[17] = "#"; - char tmp[1024] = ""; char *tmpptr; + struct ast_str *tmp = ast_str_thread_get(&voicemail_extension_list, 16); struct ast_vm_user *vmu; struct ast_vm_user svm; const char *category = NULL; @@ -4908,9 +4910,9 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ const char *alldtmf = "0123456789ABCD*#"; char flag[80]; - ast_copy_string(tmp, ext, sizeof(tmp)); - ext = tmp; - if ((context = strchr(tmp, '@'))) { + ast_str_set(&tmp, 0, "%s", ext); + ext = ast_str_buffer(tmp); + if ((context = strchr(ext, '@'))) { *context++ = '\0'; tmpptr = strchr(context, '&'); } else { |