Skip to content

Commit 6637a4d

Browse files
committed
More isolation of TLS support stuff.
1 parent d32112e commit 6637a4d

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

memtier_benchmark.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf
790790
}
791791
break;
792792
}
793+
#ifdef USE_TLS
793794
case o_tls:
794795
cfg->tls = true;
795796
break;
@@ -805,6 +806,7 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf
805806
case o_tls_skip_verify:
806807
cfg->tls_skip_verify = true;
807808
break;
809+
#endif
808810
default:
809811
return -1;
810812
break;

memtier_benchmark.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ struct benchmark_config {
4949
const char *protocol;
5050
const char *out_file;
5151
const char *client_stats;
52-
bool tls;
53-
const char *tls_cert;
54-
const char *tls_key;
55-
const char *tls_cacert;
56-
bool tls_skip_verify;
57-
#ifdef USE_TLS
58-
SSL_CTX *openssl_ctx;
59-
#endif
6052
unsigned int run_count;
6153
int debug;
6254
int show_config;
@@ -101,6 +93,14 @@ struct benchmark_config {
10193
const char *json_out_file;
10294
bool cluster_mode;
10395
struct arbitrary_command_list* arbitrary_commands;
96+
#ifdef USE_TLS
97+
bool tls;
98+
const char *tls_cert;
99+
const char *tls_key;
100+
const char *tls_cacert;
101+
bool tls_skip_verify;
102+
SSL_CTX *openssl_ctx;
103+
#endif
104104
};
105105

106106

shard_connection.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ void shard_connection::setup_event(int sockfd) {
187187
#ifdef USE_TLS
188188
if (m_config->openssl_ctx) {
189189
SSL *ctx = SSL_new(m_config->openssl_ctx);
190+
assert(ctx != NULL);
190191
m_bev = bufferevent_openssl_socket_new(m_event_base,
191192
sockfd, ctx, BUFFEREVENT_SSL_CONNECTING, BEV_OPT_CLOSE_ON_FREE);
192193
} else {

0 commit comments

Comments
 (0)