mirror of
https://github.com/coturn/coturn.git
synced 2026-05-12 09:40:35 +00:00
Show allocations increment/decrement logs behind verbose flag
This commit is contained in:
@@ -692,12 +692,13 @@ int check_new_allocation_quota(uint8_t *user, int oauth, uint8_t *realm) {
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
global_allocation_count++;
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "Global turn allocation count incremented, now %ld\n", global_allocation_count);
|
||||
size_t cur_count = ++global_allocation_count;
|
||||
#else
|
||||
size_t cur_count = (size_t)InterlockedIncrement((volatile LONG *)&global_allocation_count);
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "Global turn allocation count incremented, now %ld\n", cur_count);
|
||||
#endif
|
||||
if (turn_params.verbose > TURN_VERBOSE_NONE) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "Global turn allocation count incremented, now %ld\n", cur_count);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -731,12 +732,13 @@ void release_allocation_quota(uint8_t *user, int oauth, uint8_t *realm) {
|
||||
log_level = TURN_LOG_LEVEL_INFO;
|
||||
}
|
||||
#ifndef _MSC_VER
|
||||
global_allocation_count--;
|
||||
TURN_LOG_FUNC(log_level, "Global turn allocation count decremented, now %ld\n", global_allocation_count);
|
||||
size_t cur_count = --global_allocation_count;
|
||||
#else
|
||||
size_t cur_count = (size_t)InterlockedDecrement((volatile LONG *)&global_allocation_count);
|
||||
TURN_LOG_FUNC(log_level, "Global turn allocation count decremented, now %ld\n", cur_count);
|
||||
#endif
|
||||
if (turn_params.verbose > TURN_VERBOSE_NONE) {
|
||||
TURN_LOG_FUNC(log_level, "Global turn allocation count decremented, now %ld\n", cur_count);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user