Pipelined client: Reject any pub/sub commnd.
This commit is contained in:
parent
8744756d99
commit
48b94e50d6
|
@ -163,7 +163,10 @@ namespace resply {
|
|||
*/
|
||||
class Client : public RespCommandSerializer<Result> {
|
||||
public:
|
||||
/*! \brief A pipelined redis client. */
|
||||
/*! \brief A pipelined redis client.
|
||||
*
|
||||
* This type of client will reject any {P}{UN}SUBSCIBRE commands.
|
||||
*/
|
||||
class Pipeline : public RespCommandSerializer<Pipeline&> {
|
||||
public:
|
||||
/*! \brief Constructs a new pipelined client.
|
||||
|
|
|
@ -288,7 +288,10 @@ std::vector<Result> Client::Pipeline::send()
|
|||
|
||||
Client::Pipeline& Client::Pipeline::finish_command(const std::string& command)
|
||||
{
|
||||
if (!command.empty()) {
|
||||
std::string lower;
|
||||
std::transform(command.begin(), command.end(), lower.begin(), ::tolower);
|
||||
|
||||
if (!command.empty() && lower.find("subscribe") == std::string::npos) {
|
||||
commands_.emplace_back(command + "\r\n");
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue