summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_openssl.c
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-12-18 22:58:27 +0100
committerAlejandro Colomar <alx.manpages@gmail.com>2022-04-26 12:38:48 +0200
commitbce0f432c402ad18718aecab227b663160682ea4 (patch)
tree01f5091fc6bf12a2deb937b5ad434b65cbe8df62 /src/nxt_openssl.c
parente525605d057fd923aa2728babe5b49e95d86d22b (diff)
downloadunit-bce0f432c402ad18718aecab227b663160682ea4.tar.gz
unit-bce0f432c402ad18718aecab227b663160682ea4.tar.bz2
Removed special cases for non-NXT_CONF_VALUE_ARRAY.
The previous commit added more generic APIs for handling NXT_CONF_VALUE_ARRAY and non-NXT_CONF_VALUE_ARRAY together. Modify calling code to remove special cases for arrays and non-arrays, taking special care that the path for non arrays is logically equivalent to the previous special cased code. Use the now-generic array code only.
Diffstat (limited to 'src/nxt_openssl.c')
-rw-r--r--src/nxt_openssl.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/nxt_openssl.c b/src/nxt_openssl.c
index 1e08015e..59c58b2b 100644
--- a/src/nxt_openssl.c
+++ b/src/nxt_openssl.c
@@ -644,16 +644,10 @@ nxt_tls_ticket_keys(nxt_task_t *task, SSL_CTX *ctx, nxt_tls_init_t *tls_init,
return NXT_OK;
}
- if (nxt_conf_type(tickets_conf) == NXT_CONF_ARRAY) {
- count = nxt_conf_array_elements_count(tickets_conf);
+ count = nxt_conf_array_elements_count_or_1(tickets_conf);
- if (count == 0) {
- goto no_ticket;
- }
-
- } else {
- /* nxt_conf_type(tickets_conf) == NXT_CONF_STRING */
- count = 1;
+ if (count == 0) {
+ goto no_ticket;
}
#ifdef SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB
@@ -673,15 +667,9 @@ nxt_tls_ticket_keys(nxt_task_t *task, SSL_CTX *ctx, nxt_tls_init_t *tls_init,
i++;
- if (nxt_conf_type(tickets_conf) == NXT_CONF_ARRAY) {
- member = nxt_conf_get_array_element(tickets_conf, count - i);
- if (member == NULL) {
- break;
- }
-
- } else {
- /* nxt_conf_type(tickets_conf) == NXT_CONF_STRING */
- member = tickets_conf;
+ member = nxt_conf_get_array_element_or_itself(tickets_conf, count - i);
+ if (member == NULL) {
+ break;
}
nxt_conf_get_string(member, &value);