]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8075 updates for limit release case v1.6.0
authorWilliam King <william.king@quentustech.com>
Fri, 4 Sep 2015 21:45:37 +0000 (14:45 -0700)
committerWilliam King <william.king@quentustech.com>
Fri, 4 Sep 2015 21:46:10 +0000 (14:46 -0700)
src/mod/applications/mod_hiredis/TODO
src/mod/applications/mod_hiredis/mod_hiredis.c

index 9966f0c7a05380a24631a53b3dc470b46767db4a..08d8c0a032b8dd5f9885344e930d5aee4bb3bf65 100644 (file)
@@ -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
 
 
index f5cc90f5f353836f8e5c3ef0f4764c73a644510b..1178ba4e891b90649ee96ac969aa7e594b63735b 100644 (file)
@@ -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) {