addReplyError(c,"This Redis instance is not configured to use an ACL file. You may want to specify users via the ACL SETUSER command and then issue a CONFIG REWRITE (assuming you have a Redis configuration file set) in order to store users in the Redis configuration.");
return;
}elseif(!strcasecmp(sub,"load")&&c->argc==2){
sdserrors=ACLLoadFromFile(server.acl_filename);
if(errors==NULL){
addReply(c,shared.ok);
}else{
addReplyError(c,errors);
sdsfree(errors);
}
}elseif(!strcasecmp(sub,"save")&&c->argc==2){
if(ACLSaveToFile(server.acl_filename)==C_OK){
addReply(c,shared.ok);
}else{
addReplyError(c,"There was an error trying to save the ACLs. "
serverLog(LL_WARNING,"WARNING: the new maxmemory value set via CONFIG SET is smaller than the current memory usage. This will result in keys eviction and/or inability to accept new write commands depending on the maxmemory-policy.");
serverLog(LL_WARNING,"WARNING: the new maxmemory value set via CONFIG SET is smaller than the current memory usage. This will result in key eviction and/or the inability to accept new write commands depending on the maxmemory-policy.");
}
}
freeMemoryIfNeeded();
freeMemoryIfNeededAndSafe();
}
}
}config_set_memory_field(
}config_set_memory_field(
"proto-max-bulk-len",server.proto_max_bulk_len){
"proto-max-bulk-len",server.proto_max_bulk_len){
...
@@ -1253,7 +1358,7 @@ badfmt: /* Bad format errors */
...
@@ -1253,7 +1358,7 @@ badfmt: /* Bad format errors */
/* Attributes are not real replies, so a well formed reply should
* also have a normal reply type after the attribute. */
addReplyBulkCString(c,"Some real reply following the attribute");
}elseif(!strcasecmp(name,"push")){
addReplyPushLen(c,2);
addReplyBulkCString(c,"server-cpu-usage");
addReplyLongLong(c,42);
/* Push replies are not synchronous replies, so we emit also a
* normal reply in order for blocking clients just discarding the
* push reply, to actually consume the reply and continue. */
addReplyBulkCString(c,"Some real reply following the push reply");
}elseif(!strcasecmp(name,"true")){
addReplyBool(c,1);
}elseif(!strcasecmp(name,"false")){
addReplyBool(c,0);
}elseif(!strcasecmp(name,"verbatim")){
addReplyVerbatim(c,"This is a verbatim\nstring",25,"txt");
}else{
addReplyError(c,"Wrong protocol type name. Please use one of the following: string|integer|double|bignum|null|array|set|map|attrib|push|verbatim|true|false|state|err|bloberr");