]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix bug from the *cough* FRICKING MAILING LIST WHERE IT SHOULD NOT HAVE BEEN REPORTED...
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 31 May 2011 14:53:39 +0000 (09:53 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 31 May 2011 14:53:39 +0000 (09:53 -0500)
libs/esl/src/esl_event.c
src/switch_channel.c
src/switch_event.c

index 28723928e39d4102d1ccc29250ad5ae055f33ba3..7aa12a8cd67c1bcb0c7b60b4d66e3979d9884636 100644 (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);
                }
index d31b75e4780c3d16e1ed930479d0dc153c5a2bbd..ebddafb2364efbcbd4ee9dce05dbb1c837d13fc2 100644 (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) {
index f362bb112b86c33f95afaa370ee161b9bf87bd68..b1f5762887be31a4ec26f2a6fcb2ca61827bb7af 100644 (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);
                }