Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/commands.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)},
Expand Down
17 changes: 17 additions & 0 deletions src/commands/pasten.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
6 changes: 6 additions & 0 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down