BUG/MINOR: ssl: support tune.ssl.cachesize 0 again

Since the split of the shctx and the ssl cache, we lost the ability to
disable the cache with tune.ssl.cachesize 0.

Worst than that, when using this configuration, haproxy segfaults during
the configuration parsing.

Must be backported to 1.8.
This commit is contained in:
William Lallemand 2017-12-04 18:46:39 +01:00 committed by Willy Tarreau
parent 6c71e4696b
commit c61c0b371b

View File

@ -4705,7 +4705,7 @@ int ssl_sock_prepare_bind_conf(struct bind_conf *bind_conf)
return -1; return -1;
} }
} }
if (!ssl_shctx) { if (!ssl_shctx && global.tune.sslcachesize) {
alloc_ctx = shctx_init(&ssl_shctx, global.tune.sslcachesize, alloc_ctx = shctx_init(&ssl_shctx, global.tune.sslcachesize,
sizeof(struct sh_ssl_sess_hdr) + SHSESS_BLOCK_MIN_SIZE, sizeof(struct sh_ssl_sess_hdr) + SHSESS_BLOCK_MIN_SIZE,
sizeof(*sh_ssl_sess_tree), sizeof(*sh_ssl_sess_tree),