From 17453e00790a4ba6f9f6d66f03e24b0e3030b9a8 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Mon, 31 Oct 2022 17:49:17 +0300 Subject: [PATCH] [Core] Remove deprecated SWITCH_STACK_NODUP flag. Change switch_event_add_header_string() behavior to always dup. --- src/include/switch_types.h | 5 ++--- src/switch_event.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 3ec80a7afd..7b519899af 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1203,9 +1203,8 @@ SWITCH_STACK_TOP - Stack on the top typedef enum { SWITCH_STACK_BOTTOM = (1 << 0), SWITCH_STACK_TOP = (1 << 1), - SWITCH_STACK_NODUP = (1 << 2), - SWITCH_STACK_UNSHIFT = (1 << 3), - SWITCH_STACK_PUSH = (1 << 4), + SWITCH_STACK_UNSHIFT = (1 << 2), + SWITCH_STACK_PUSH = (1 << 3) } switch_stack_t; /*! diff --git a/src/switch_event.c b/src/switch_event.c index a8ba532d19..843469bd72 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -1246,7 +1246,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_header_string_nodup(switch_even SWITCH_DECLARE(switch_status_t) switch_event_add_header_string(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *data) { if (data) { - return switch_event_base_add_header(event, stack, header_name, (stack & SWITCH_STACK_NODUP) ? (char *)data : DUP(data)); + return switch_event_base_add_header(event, stack, header_name, DUP(data)); } return SWITCH_STATUS_GENERR; }