summaryrefslogtreecommitdiff
path: root/runtest-cluster
diff options
context:
space:
mode:
authorzhenwei pi <pizhenwei@bytedance.com>2022-08-22 15:09:59 +0800
committerzhenwei pi <pizhenwei@bytedance.com>2022-08-22 15:09:59 +0800
commit8234a5123d8727a0b72c7b1a2524edd113ffe016 (patch)
tree1418f61000d9be9a0c7d2d616be02b7cd346ae78 /runtest-cluster
parentbff7ecc7864716c14fbb399f19acaee364975b29 (diff)
downloadredis-8234a5123d8727a0b72c7b1a2524edd113ffe016.tar.gz
Introduce connection layer framework
Use connTypeRegister() to register a connection type into redis, and query connection by connectionByType() via type. With this change, we can hide TLS specified methods into connection type: - void tlsInit(void); - void tlsCleanup(void); - int tlsConfigure(redisTLSContextConfig *ctx_config); - int isTlsConfigured(void); Merge isTlsConfigured & tlsConfigure, use an argument *reconfigure* to distinguish: tlsConfigure(&server.tls_ctx_config) -> onnTypeConfigure(CONN_TYPE_TLS, &server.tls_ctx_config, 1) isTlsConfigured() && tlsConfigure(&server.tls_ctx_config) -> connTypeConfigure(CONN_TYPE_TLS, &server.tls_ctx_config, 0) Finally, we can remove USE_OPENSSL from config.c. If redis is built without TLS, and still run redis with TLS, then redis reports: # Missing implement of connection type 1 # Failed to configure TLS. Check logs for more info. The log can be optimised, let's leave it in the future. Maybe we can use connection type as a string. Although uninitialized fields of a static struct are zero, we still set them as NULL explicitly in socket.c, let them clear to read & maintain: .init = NULL, .cleanup = NULL, .configure = NULL, Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Diffstat (limited to 'runtest-cluster')
0 files changed, 0 insertions, 0 deletions