From 52dba90640396ba703b3a17fabad449734240691 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Tue, 3 Mar 2009 17:14:58 +0000 Subject: [PATCH] Revert 12369 since inserting NULL is the same as deleting in sqlite3 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12373 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_channel.h | 8 -------- src/switch_channel.c | 12 ------------ src/switch_ivr_async.c | 4 ++-- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/include/switch_channel.h b/src/include/switch_channel.h index 2075fb1072..4824a0c8a3 100644 --- a/src/include/switch_channel.h +++ b/src/include/switch_channel.h @@ -409,14 +409,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *cha */ SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, const char *key); -/*! - \brief Unsets private from a given channel - \param channel channel to unsets data from - \param key your private data's unique keyname - \return void SWITCH_STATUS_SUCCESS if data was unset -*/ -SWITCH_DECLARE(switch_status_t) switch_channel_unset_private(switch_channel_t *channel, const char *key); - /*! \brief Assign a name to a given channel \param channel channel to assign name to diff --git a/src/switch_channel.c b/src/switch_channel.c index 966a10ee83..b671d0ecb6 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -565,18 +565,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *cha return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status_t) switch_channel_unset_private(switch_channel_t *channel, const char *key) -{ - switch_status_t status; - switch_assert(channel != NULL); - - switch_mutex_lock(channel->profile_mutex); - status = switch_core_hash_delete(channel->private_hash, key); - switch_mutex_unlock(channel->profile_mutex); - - return status; -} - SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, const char *key) { void *val; diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 778b44167a..82bec090e8 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -188,7 +188,7 @@ static switch_bool_t write_displace_callback(switch_media_bug_t *bug, void *user switch_core_file_close(&dh->fh); if (session && (channel = switch_core_session_get_channel(session))) { - switch_channel_unset_private(channel, dh->file); + switch_channel_set_private(channel, dh->file, NULL); } } break; @@ -269,7 +269,7 @@ static switch_bool_t read_displace_callback(switch_media_bug_t *bug, void *user_ switch_core_file_close(&dh->fh); if (session && (channel = switch_core_session_get_channel(session))) { - switch_channel_unset_private(channel, dh->file); + switch_channel_set_private(channel, dh->file, NULL); } } break;