fix bug from the *cough* FRICKING MAILING LIST WHERE IT SHOULD NOT HAVE BEEN REPORTED FROM *cough*

This commit is contained in:
Anthony Minessale 2011-05-31 09:53:39 -05:00
parent 43a5af7df6
commit 37064511e4
3 changed files with 21 additions and 3 deletions

View File

@ -478,6 +478,13 @@ static esl_status_t esl_event_base_add_header(esl_event_t *event, esl_stack_t st
if (!header) {
if (esl_strlen_zero(data)) {
esl_event_del_header(event, header_name);
FREE(data);
goto end;
}
if (esl_test_flag(event, ESL_EF_UNIQ_HEADERS)) {
esl_event_del_header(event, header_name);
}

View File

@ -1032,7 +1032,9 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_cha
switch_mutex_lock(channel->profile_mutex);
if (channel->variables && !zstr(varname)) {
if (!zstr(value)) {
if (zstr(value)) {
switch_event_del_header(channel->variables, varname);
} else {
int ok = 1;
if (var_check) {
@ -1061,7 +1063,9 @@ SWITCH_DECLARE(switch_status_t) switch_channel_add_variable_var_check(switch_cha
switch_mutex_lock(channel->profile_mutex);
if (channel->variables && !zstr(varname)) {
if (!zstr(value)) {
if (zstr(value)) {
switch_event_del_header(channel->variables, varname);
} else {
int ok = 1;
if (var_check) {

View File

@ -916,7 +916,7 @@ static switch_status_t switch_event_base_add_header(switch_event_t *event, switc
}
header_name = real_header_name;
}
if (index_ptr || (stack & SWITCH_STACK_PUSH) || (stack & SWITCH_STACK_UNSHIFT)) {
if (!(header = switch_event_get_header_ptr(event, header_name)) && index_ptr) {
@ -970,6 +970,13 @@ static switch_status_t switch_event_base_add_header(switch_event_t *event, switc
if (!header) {
if (zstr(data)) {
switch_event_del_header(event, header_name);
FREE(data);
goto end;
}
if (switch_test_flag(event, EF_UNIQ_HEADERS)) {
switch_event_del_header(event, header_name);
}