mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 09:58:17 +00:00
FS-6402 part 2
This commit is contained in:
@@ -818,7 +818,7 @@ switch_status_t rtmp_session_request(rtmp_profile_t *profile, rtmp_session_t **n
|
||||
|
||||
static void rtmp_garbage_colletor(void)
|
||||
{
|
||||
switch_hash_index_t *hi;
|
||||
switch_hash_index_t *hi = NULL;
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "RTMP Garbage Collection\n");
|
||||
|
||||
@@ -827,7 +827,7 @@ static void rtmp_garbage_colletor(void)
|
||||
|
||||
top:
|
||||
|
||||
for (hi = switch_core_hash_first( rtmp_globals.session_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
for (hi = switch_core_hash_first_iter( rtmp_globals.session_hash, hi); hi; hi = switch_core_hash_next(&hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
@@ -842,6 +842,7 @@ static void rtmp_garbage_colletor(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
switch_safe_free(hi);
|
||||
|
||||
switch_thread_rwlock_unlock(rtmp_globals.session_rwlock);
|
||||
}
|
||||
@@ -868,7 +869,7 @@ switch_status_t rtmp_real_session_destroy(rtmp_session_t **rsession)
|
||||
int sess = 0;
|
||||
|
||||
switch_thread_rwlock_rdlock((*rsession)->session_rwlock);
|
||||
for (hi = switch_core_hash_first( (*rsession)->session_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
for (hi = switch_core_hash_first((*rsession)->session_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
@@ -1086,7 +1087,7 @@ switch_status_t rtmp_profile_destroy(rtmp_profile_t **profile) {
|
||||
switch_thread_rwlock_wrlock((*profile)->rwlock);
|
||||
|
||||
/* Kill all sessions */
|
||||
while ((hi = switch_core_hash_first( (*profile)->session_hash))) {
|
||||
while ((hi = switch_core_hash_first((*profile)->session_hash))) {
|
||||
void *val;
|
||||
rtmp_session_t *session;
|
||||
const void *key;
|
||||
@@ -1633,7 +1634,7 @@ SWITCH_STANDARD_API(rtmp_function)
|
||||
stream->write_function(stream, "\nSessions:\n");
|
||||
stream->write_function(stream, "uuid,address,user,domain,flashVer,state\n");
|
||||
switch_thread_rwlock_rdlock(profile->session_rwlock);
|
||||
for (hi = switch_core_hash_first( profile->session_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
for (hi = switch_core_hash_first(profile->session_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
@@ -1655,7 +1656,7 @@ SWITCH_STANDARD_API(rtmp_function)
|
||||
stream->write_function(stream, "user,nickname,uuid\n");
|
||||
|
||||
switch_thread_rwlock_rdlock(profile->reg_rwlock);
|
||||
for (hi = switch_core_hash_first( profile->reg_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
for (hi = switch_core_hash_first(profile->reg_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
@@ -1681,7 +1682,7 @@ SWITCH_STANDARD_API(rtmp_function)
|
||||
} else {
|
||||
switch_hash_index_t *hi;
|
||||
switch_thread_rwlock_rdlock(rtmp_globals.profile_rwlock);
|
||||
for (hi = switch_core_hash_first( rtmp_globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
for (hi = switch_core_hash_first(rtmp_globals.profile_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
@@ -1805,7 +1806,7 @@ static switch_status_t console_complete_hashtable(switch_hash_t *hash, const cha
|
||||
switch_console_callback_match_t *my_matches = NULL;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
for (hi = switch_core_hash_first( hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
for (hi = switch_core_hash_first(hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
switch_core_hash_this(hi, &vvar, NULL, &val);
|
||||
switch_console_push_match(&my_matches, (const char *) vvar);
|
||||
}
|
||||
@@ -1930,10 +1931,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rtmp_load)
|
||||
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_rtmp_shutdown)
|
||||
{
|
||||
switch_hash_index_t *hi;
|
||||
switch_hash_index_t *hi = NULL;
|
||||
|
||||
switch_mutex_lock(rtmp_globals.mutex);
|
||||
while ((hi = switch_core_hash_first( rtmp_globals.profile_hash))) {
|
||||
while ((hi = switch_core_hash_first_iter( rtmp_globals.profile_hash, hi))) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
|
@@ -243,7 +243,7 @@ switch_status_t rtmp_check_auth(rtmp_session_t *rsession, const char *user, cons
|
||||
if (disallow_multiple_registration) {
|
||||
switch_hash_index_t *hi;
|
||||
switch_thread_rwlock_rdlock(rsession->profile->session_rwlock);
|
||||
for (hi = switch_core_hash_first( rsession->profile->session_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
for (hi = switch_core_hash_first(rsession->profile->session_hash); hi; hi = switch_core_hash_next(&hi)) {
|
||||
void *val;
|
||||
const void *key;
|
||||
switch_ssize_t keylen;
|
||||
|
Reference in New Issue
Block a user