From 9bb318b63334a11bc14b32c44b217caf82d835ab Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Sat, 18 Nov 2023 20:09:04 +0000 Subject: [PATCH] Fixed tls-protocols parsing --- memtier_benchmark.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/memtier_benchmark.cpp b/memtier_benchmark.cpp index 315af342..aece444f 100755 --- a/memtier_benchmark.cpp +++ b/memtier_benchmark.cpp @@ -896,8 +896,7 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf break; case o_tls_protocols: { - const char tls_delimiter = ','; - char* tls_token = strtok(optarg, &tls_delimiter); + char* tls_token = strtok(optarg, ", \n\t"); while (tls_token != 0) { if (!strcasecmp(tls_token, "tlsv1")) cfg->tls_protocols |= REDIS_TLS_PROTO_TLSv1; @@ -913,12 +912,12 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf return -1; #endif } else { - fprintf(stderr, "Invalid tls-protocols specified %s." + fprintf(stderr, "Invalid tls-protocols specified %s. " "Use a combination of 'TLSv1', 'TLSv1.1', 'TLSv1.2' and 'TLSv1.3'.", tls_token); return -1; break; } - tls_token = strtok(0, &tls_delimiter); + tls_token = strtok(0, ", \n\t"); } break; }