Skip to content

Commit

Permalink
Fixed tls-protocols parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecosta90 committed Nov 18, 2023
1 parent 6523a56 commit 9bb318b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions memtier_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 9bb318b

Please sign in to comment.