mirror of
https://github.com/redis/redis.git
synced 2026-02-03 20:39:54 -05:00
Merge be21a726c3 into b5a37c0e42
This commit is contained in:
commit
8720b5b359
2 changed files with 21 additions and 1 deletions
|
|
@ -3196,7 +3196,7 @@ standardConfig static_configs[] = {
|
|||
createEnumConfig("sanitize-dump-payload", NULL, DEBUG_CONFIG | MODIFIABLE_CONFIG, sanitize_dump_payload_enum, server.sanitize_dump_payload, SANITIZE_DUMP_NO, NULL, NULL),
|
||||
createEnumConfig("enable-protected-configs", NULL, IMMUTABLE_CONFIG, protected_action_enum, server.enable_protected_configs, PROTECTED_ACTION_ALLOWED_NO, NULL, NULL),
|
||||
createEnumConfig("enable-debug-command", NULL, IMMUTABLE_CONFIG, protected_action_enum, server.enable_debug_cmd, PROTECTED_ACTION_ALLOWED_NO, NULL, NULL),
|
||||
createEnumConfig("enable-module-command", NULL, IMMUTABLE_CONFIG, protected_action_enum, server.enable_module_cmd, PROTECTED_ACTION_ALLOWED_NO, NULL, NULL),
|
||||
createEnumConfig("enable-module-command", NULL, IMMUTABLE_CONFIG, protected_action_enum, server.enable_module_cmd, PROTECTED_ACTION_ALLOWED_LOCAL, NULL, NULL),
|
||||
createEnumConfig("cluster-preferred-endpoint-type", NULL, MODIFIABLE_CONFIG, cluster_preferred_endpoint_type_enum, server.cluster_preferred_endpoint_type, CLUSTER_ENDPOINT_TYPE_IP, NULL, NULL),
|
||||
createEnumConfig("propagation-error-behavior", NULL, MODIFIABLE_CONFIG, propagation_error_behavior_enum, server.propagation_error_behavior, PROPAGATION_ERR_BEHAVIOR_IGNORE, NULL, NULL),
|
||||
createEnumConfig("shutdown-on-sigint", NULL, MODIFIABLE_CONFIG | MULTI_ARG_CONFIG, shutdown_on_sig_enum, server.shutdown_on_sigint, 0, isValidShutdownOnSigFlags, NULL),
|
||||
|
|
|
|||
20
src/module.c
20
src/module.c
|
|
@ -13331,6 +13331,23 @@ void modulePipeReadable(aeEventLoop *el, int fd, void *privdata, int mask) {
|
|||
eventLoopHandleOneShotEvents();
|
||||
}
|
||||
|
||||
/* Helper for addReplyLoadedModules(): given a list of modules, return
|
||||
* an SDS string in the form "[datatype|datatype2|...]" */
|
||||
sds getModulesDataTypesList(list *l) {
|
||||
listIter li;
|
||||
listNode *ln;
|
||||
listRewind(l, &li);
|
||||
sds output = sdsnew("[");
|
||||
while((ln = listNext(&li))) {
|
||||
moduleType *mt = ln->value;
|
||||
output = sdscat(output,mt->name);
|
||||
if (ln != listLast(l))
|
||||
output = sdscat(output,"|");
|
||||
}
|
||||
output = sdscat(output,"]");
|
||||
return output;
|
||||
}
|
||||
|
||||
/* Helper function for the MODULE and HELLO command: send the list of the
|
||||
* loaded modules to the client. */
|
||||
void addReplyLoadedModules(client *c) {
|
||||
|
|
@ -13348,11 +13365,14 @@ void addReplyLoadedModules(client *c) {
|
|||
sds name = dictGetKey(de);
|
||||
struct RedisModule *module = dictGetVal(de);
|
||||
sds path = module->loadmod->path;
|
||||
sds dataTypes = getModulesDataTypesList(module->types);
|
||||
addReplyMapLen(c,4);
|
||||
addReplyBulkCString(c,"name");
|
||||
addReplyBulkCBuffer(c,name,sdslen(name));
|
||||
addReplyBulkCString(c,"ver");
|
||||
addReplyLongLong(c,module->ver);
|
||||
addReplyBulkCString(c, "data types");
|
||||
addReplyBulkCBuffer(c, dataTypes, sdslen(dataTypes));
|
||||
addReplyBulkCString(c,"path");
|
||||
addReplyBulkCBuffer(c,path,sdslen(path));
|
||||
addReplyBulkCString(c,"args");
|
||||
|
|
|
|||
Loading…
Reference in a new issue