Don't add an empty MESSAGE_DATA(key) header if it doesn't already exist.

Doing Set(MESSAGE_DATA(key)=) would add an empty key header if the key
header did not already exist.  If it already existed it would delete it.

* Made msg_set_var_full() exit early if the named variable did not already
exist and the value to set is empty.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@361522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
10
Richard Mudgett 14 years ago
parent 455c5c8c66
commit 4996e7978f

@ -494,6 +494,9 @@ static int msg_set_var_full(struct ast_msg *msg, const char *name, const char *v
struct msg_data *data;
if (!(data = msg_data_find(msg->vars, name))) {
if (ast_strlen_zero(value)) {
return 0;
}
if (!(data = msg_data_alloc())) {
return -1;
};

Loading…
Cancel
Save