Skip to content

Commit

Permalink
chore: add SendRaw()
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Oleshko <[email protected]>
  • Loading branch information
dranikpg committed Oct 22, 2024
1 parent 0768e24 commit b7f4294
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/facade/reply_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ void MCReplyBuilder::SendNotFound() {
SendSimpleString("NOT_FOUND");
}

void MCReplyBuilder::SendRaw(std::string_view str) {
ReplyScope scope(this);
WriteRef(str);
}

void RedisReplyBuilderBase::SendNull() {
ReplyScope scope(this);
resp3_ ? WritePieces(kNullStringR3) : WritePieces(kNullStringR2);
Expand Down
2 changes: 2 additions & 0 deletions src/facade/reply_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class MCReplyBuilder : public SinkReplyBuilder {
void SendSimpleString(std::string_view str) final;
void SendProtocolError(std::string_view str) final;

void SendRaw(std::string_view str);

void SetNoreply(bool noreply) {
noreply_ = noreply;
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/server_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ void ServerFamily::StatsMC(std::string_view section, facade::ConnectionContext*
absl::StrAppend(&info, "END\r\n");

MCReplyBuilder* builder = static_cast<MCReplyBuilder*>(cntx->reply_builder());
// builder->SendRaw(info);
builder->SendRaw(info);

#undef ADD_LINE
}
Expand Down

0 comments on commit b7f4294

Please sign in to comment.