MUSE_MODULE_COMMAND_CREATE_SERVER_ACK,
MUSE_MODULE_COMMAND_RESOURCE_NOT_AVAILABLE,
MUSE_MODULE_COMMAND_EXTERNAL_STORAGE_STATE_CHANGED,
+ MUSE_MODULE_COMMAND_CREATE_CAUTION,
MUSE_MODULE_COMMAND_MAX
} muse_module_command_e;
#define TIMEOUT "timeout"
#define DIABLE_WATCHDOG_API_INDEX "disable_watchdog_api"
#define MAX_INSTANCE "max_instance"
+#define CAUTION_INSTANCE "caution_instance"
#define DEFAULT_WATCHDOG_MIN_TIMEOUT 5
#define DEFAULT_WATCHDOG_MAX_TIMEOUT 60
#define DEFAULT_MEMORY_LEAK_THRESHOLD 50000 /* 50MB */
#define DEFAULT_WATCHDOG_DISABLED_API_INDEX -1 /* Watchdog is applied to all dispatcher functions */
#define DEFAULT_MAX_INSTANCE -1 /* Unlimited */
+#define DEFAULT_CAUTION_INSTANCE -1
typedef struct host_info {
char *path;
int timeout;
int disable_watchdog_api;
int max_instance;
+ int caution_instance;
} host_info_t;
typedef struct ms_config {
snprintf(key, MUSE_MSG_LEN_MAX, "%s%s%s", host, INI_PARSER_COLON, MAX_INSTANCE);
conf->host_infos[host_idx]->max_instance = _ms_config_get_int(conf->muse_dict, key, DEFAULT_MAX_INSTANCE);
+ /* caution instance */
+ snprintf(key, MUSE_MSG_LEN_MAX, "%s%s%s", host, INI_PARSER_COLON, CAUTION_INSTANCE);
+ conf->host_infos[host_idx]->caution_instance = _ms_config_get_int(conf->muse_dict, key, DEFAULT_CAUTION_INSTANCE);
+
host = strtok_r(NULL, INI_PARSER_COMMA, &ptr);
conf->host_cnt++;
free(key);
muse_module_h connecting_m;
char pids[MUSE_MSG_LEN_MAX] = {'\0',};
char pid[MUSE_PARAM_MAX] = {'\0',};
- int idx, len;
+ int idx, len, caution_instance;
+ ms_config_t *conf = ms_get_instance()->conf;
g_return_if_fail(m);
g_return_if_fail(connection);
g_return_if_fail(queue);
+ g_return_if_fail(conf);
len = g_queue_get_length(queue);
}
SECURE_LOGI("total number of module = %d ( %s) - %s %p from pid %d %s client (count %d)",
- len, pids, connection_cmd[cmd], m, m->pid, ms_get_instance()->conf->host[m->idx], connection->instance_count[m->idx]);
+ len, pids, connection_cmd[cmd], m, m->pid, conf->host[m->idx], connection->instance_count[m->idx]);
+
+ caution_instance = conf->host_infos[m->idx]->caution_instance;
+
+ if (caution_instance != DEFAULT_CAUTION_INSTANCE && connection->instance_count[m->idx] > caution_instance) {
+ LOGI("[MUSE_MODULE_COMMAND_CREATE_CAUTION] player # %d | camera # %d | recorder # %d > %d",
+ connection->instance_count[MUSE_PLAYER], connection->instance_count[MUSE_CAMERA], connection->instance_count[MUSE_RECORDER], caution_instance);
+ ms_cmd_dispatch(m, MUSE_MODULE_COMMAND_CREATE_CAUTION);
+ }
}
int ms_connection_register(muse_module_h m)