diff --git a/src/commands.def b/src/commands.def index aab6185314e..a89dbc53557 100644 --- a/src/commands.def +++ b/src/commands.def @@ -1802,6 +1802,23 @@ struct COMMAND_ARG HELLO_Args[] = { {MAKE_ARG("arguments",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_OPTIONAL,3,NULL),.subargs=HELLO_arguments_Subargs}, }; +/********** PASTEN ********************/ + +#ifndef SKIP_CMD_HISTORY_TABLE +/* PASTEN history */ +#define PASTEN_History NULL +#endif + +#ifndef SKIP_CMD_TIPS_TABLE +/* PASTEN tips */ +#define PASTEN_Tips NULL +#endif + +#ifndef SKIP_CMD_KEY_SPECS_TABLE +/* PASTEN key specs */ +#define PASTEN_Keyspecs NULL +#endif + /********** PING ********************/ #ifndef SKIP_CMD_HISTORY_TABLE @@ -11725,6 +11742,7 @@ struct COMMAND_STRUCT redisCommandTable[] = { {MAKE_CMD("client","A container for client connection commands.","Depends on subcommand.","2.4.0",CMD_DOC_NONE,NULL,NULL,"connection",COMMAND_GROUP_CONNECTION,CLIENT_History,0,CLIENT_Tips,0,NULL,-2,CMD_SENTINEL,0,CLIENT_Keyspecs,0,NULL,0),.subcommands=CLIENT_Subcommands}, {MAKE_CMD("echo","Returns the given string.","O(1)","1.0.0",CMD_DOC_NONE,NULL,NULL,"connection",COMMAND_GROUP_CONNECTION,ECHO_History,0,ECHO_Tips,0,echoCommand,2,CMD_LOADING|CMD_STALE|CMD_FAST,ACL_CATEGORY_CONNECTION,ECHO_Keyspecs,0,NULL,1),.args=ECHO_Args}, {MAKE_CMD("hello","Handshakes with the Redis server.","O(1)","6.0.0",CMD_DOC_NONE,NULL,NULL,"connection",COMMAND_GROUP_CONNECTION,HELLO_History,1,HELLO_Tips,0,helloCommand,-1,CMD_NOSCRIPT|CMD_LOADING|CMD_STALE|CMD_FAST|CMD_NO_AUTH|CMD_SENTINEL|CMD_ALLOW_BUSY,ACL_CATEGORY_CONNECTION,HELLO_Keyspecs,0,NULL,1),.args=HELLO_Args}, +{MAKE_CMD("pasten","Returns the best number.","O(1)","8.6.1",CMD_DOC_NONE,NULL,NULL,"connection",COMMAND_GROUP_CONNECTION,PASTEN_History,0,PASTEN_Tips,0,pastenCommand,-1,0,ACL_CATEGORY_CONNECTION,PASTEN_Keyspecs,0,NULL,0)}, {MAKE_CMD("ping","Returns the server's liveliness response.","O(1)","1.0.0",CMD_DOC_NONE,NULL,NULL,"connection",COMMAND_GROUP_CONNECTION,PING_History,0,PING_Tips,2,pingCommand,-1,CMD_FAST|CMD_SENTINEL,ACL_CATEGORY_CONNECTION,PING_Keyspecs,0,NULL,1),.args=PING_Args}, {MAKE_CMD("quit","Closes the connection.","O(1)","1.0.0",CMD_DOC_DEPRECATED,"just closing the connection","7.2.0","connection",COMMAND_GROUP_CONNECTION,QUIT_History,0,QUIT_Tips,0,quitCommand,-1,CMD_ALLOW_BUSY|CMD_NOSCRIPT|CMD_LOADING|CMD_STALE|CMD_FAST|CMD_NO_AUTH,ACL_CATEGORY_CONNECTION,QUIT_Keyspecs,0,NULL,0)}, {MAKE_CMD("reset","Resets the connection.","O(1)","6.2.0",CMD_DOC_NONE,NULL,NULL,"connection",COMMAND_GROUP_CONNECTION,RESET_History,0,RESET_Tips,0,resetCommand,1,CMD_NOSCRIPT|CMD_LOADING|CMD_STALE|CMD_FAST|CMD_NO_AUTH|CMD_ALLOW_BUSY,ACL_CATEGORY_CONNECTION,RESET_Keyspecs,0,NULL,0)}, diff --git a/src/commands/pasten.json b/src/commands/pasten.json new file mode 100644 index 00000000000..1009dbfcf55 --- /dev/null +++ b/src/commands/pasten.json @@ -0,0 +1,17 @@ +{ + "PASTEN": { + "summary": "Returns the best number.", + "complexity": "O(1)", + "group": "connection", + "since": "8.6.1", + "arity": -1, + "function": "pastenCommand", + "acl_categories": [ + "CONNECTION" + ], + "reply_schema": { + "description": "The best number", + "type": "integer" + } + } +} diff --git a/src/networking.c b/src/networking.c index 13fba42539e..58eb579861d 100644 --- a/src/networking.c +++ b/src/networking.c @@ -4833,6 +4833,12 @@ void helloCommand(client *c) { addReplyLoadedModules(c); } +/* PASTEN */ +void pastenCommand(client *c) { + addReplyLongLong(c, 80); + return; +} + /* This callback is bound to POST and "Host:" command names. Those are not * really commands, but are used in security attacks in order to talk to * Redis instances via HTTP, with a technique called "cross protocol scripting" diff --git a/src/server.h b/src/server.h index 5c44150526c..7f5a8ade63f 100644 --- a/src/server.h +++ b/src/server.h @@ -4352,6 +4352,7 @@ int verifyDumpPayload(unsigned char *p, size_t len, uint16_t *rdbver_ptr); void dumpCommand(client *c); void clientCommand(client *c); void helloCommand(client *c); +void pastenCommand(client *c); void clientSetinfoCommand(client *c); void evalCommand(client *c); void evalRoCommand(client *c);