提交 16d600c0 authored 作者: William King's avatar William King

FS-8075 updates for limit release case

上级 6445012d
......@@ -2,5 +2,6 @@
2. add lock for hiredis_profile for destroy vs running commands
3. Look into refactor/cleanup of xml processing
4. Add tab complete for profile names for APIs, and possibly for supported actions(and in theory look into key listing from redis)
5. Add linked list session pvt structure for keeping track of limit incr's on a session by session basis
......@@ -93,7 +93,7 @@ SWITCH_STANDARD_API(raw_api)
data++;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "hiredis: debug: profile[%s] for command [%s]\n", input, data);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "hiredis: debug: profile[%s] for command [%s]\n", input, data);
profile = switch_core_hash_find(mod_hiredis_globals.profiles, input);
......@@ -127,7 +127,7 @@ SWITCH_LIMIT_INCR(hiredis_limit_incr)
time_t now = switch_epoch_time_now(NULL);
switch_status_t status = SWITCH_STATUS_SUCCESS;
if ( !zstr(realm) ) {
if ( zstr(realm) ) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "hiredis: realm must be defined\n");
switch_goto_status(SWITCH_STATUS_GENERR, done);
}
......@@ -185,6 +185,11 @@ SWITCH_LIMIT_RELEASE(hiredis_limit_release)
switch_goto_status(SWITCH_STATUS_GENERR, done);
}
if ( !realm && !resource ) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "hiredis does not yet support release on NULL realm[%s] and resource[%s]\n", realm, resource);
switch_goto_status(SWITCH_STATUS_GENERR, done);
}
hashkey = switch_mprintf("decr %s", resource);
if ( hiredis_profile_execute_sync(profile, hashkey, &response) != SWITCH_STATUS_SUCCESS) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论