You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by hu...@apache.org on 2022/10/11 05:14:22 UTC
[incubator-kvrocks] branch unstable updated: Fix shouldn't lowercase the configuration value in kvrocks2redis(#971)
This is an automated email from the ASF dual-hosted git repository.
hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 79351f0 Fix shouldn't lowercase the configuration value in kvrocks2redis(#971)
79351f0 is described below
commit 79351f0a65fd425e013aed402808a575f8453c30
Author: manchurio <82...@users.noreply.github.com>
AuthorDate: Tue Oct 11 13:14:16 2022 +0800
Fix shouldn't lowercase the configuration value in kvrocks2redis(#971)
---
tools/kvrocks2redis/config.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/kvrocks2redis/config.cc b/tools/kvrocks2redis/config.cc
index b935eca..b1826da 100644
--- a/tools/kvrocks2redis/config.cc
+++ b/tools/kvrocks2redis/config.cc
@@ -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;
@@ -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) {
@@ -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();