Skip to content

Commit

Permalink
Fix shouldn't lowercase the configuration value in kvrocks2redis(#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
manchurio authored Oct 11, 2022
1 parent d33ef02 commit 79351f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/kvrocks2redis/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Status Config::parseConfigFromString(std::string input) {
// omit empty line and comment
if (args.empty() || args[0].front() == '#') return Status::OK();

args[0] = Util::ToLower(args[0]);
size_t size = args.size();
if (size == 2 && args[0] == "daemonize") {
int i;
Expand Down Expand Up @@ -89,7 +90,7 @@ Status Config::parseConfigFromString(std::string input) {
kvrocks_host = args[1];
// In new versions, we don't use extra port to implement replication
kvrocks_port = std::stoi(args[2]);
if (kvrocks_port <= 0 || kvrocks_port >= 65535) {
if (kvrocks_port <= 0 || kvrocks_port > 65535) {
return Status(Status::NotOK, "kvrocks port range should be between 0 and 65535");
}
if (size == 4) {
Expand Down Expand Up @@ -129,7 +130,6 @@ Status Config::Load(std::string path) {
int line_num = 1;
while (!file.eof()) {
std::getline(file, line);
line = Util::ToLower(line);
Status s = parseConfigFromString(line);
if (!s.IsOK()) {
file.close();
Expand Down

0 comments on commit 79351f0

Please sign in to comment.