[multiple] avoid duplicate parsing in trigger func (#3056)

x-ref:
  "OCSP Stapling reload seems not to work"
  https://redmine.lighttpd.net/issues/3056
master
Glenn Strauss 2 years ago
parent 81e4f4c4a7
commit 33e400b429

@ -183,7 +183,9 @@ TRIGGER_FUNC(mod_auth_periodic)
/* future: might construct array of (http_auth_cache *) at startup
* to avoid the need to search for them here */
for (int i = 0, used = p->nconfig; i < used; ++i) {
/* (init i to 0 if global context; to 1 to skip empty global context) */
if (NULL == p->cvlist) return HANDLER_GO_ON;
for (int i = !p->cvlist[0].v.u2[1], used = p->nconfig; i < used; ++i) {
const config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0];
for (; cpv->k_id != -1; ++cpv) {
if (cpv->k_id != 3) continue; /* k_id == 3 for auth.cache */

@ -993,7 +993,9 @@ mod_gnutls_refresh_stapling_files (server *srv, const plugin_data *p, const time
{
/* future: might construct array of (plugin_cert *) at startup
* to avoid the need to search for them here */
for (int i = 0, used = p->nconfig; i < used; ++i) {
/* (init i to 0 if global context; to 1 to skip empty global context) */
if (NULL == p->cvlist) return;
for (int i = !p->cvlist[0].v.u2[1], used = p->nconfig; i < used; ++i) {
const config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0];
for (; cpv->k_id != -1; ++cpv) {
if (cpv->k_id != 0) continue; /* k_id == 0 for ssl.pemfile */

@ -1101,7 +1101,9 @@ mod_nss_refresh_stapling_files (server *srv, const plugin_data *p, const time_t
{
/* future: might construct array of (plugin_cert *) at startup
* to avoid the need to search for them here */
for (int i = 0, used = p->nconfig; i < used; ++i) {
/* (init i to 0 if global context; to 1 to skip empty global context) */
if (NULL == p->cvlist) return;
for (int i = !p->cvlist[0].v.u2[1], used = p->nconfig; i < used; ++i) {
const config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0];
for (; cpv->k_id != -1; ++cpv) {
if (cpv->k_id != 0) continue; /* k_id == 0 for ssl.pemfile */

@ -1568,7 +1568,9 @@ mod_openssl_refresh_stapling_files (server *srv, const plugin_data *p, const tim
{
/* future: might construct array of (plugin_cert *) at startup
* to avoid the need to search for them here */
for (int i = 0, used = p->nconfig; i < used; ++i) {
/* (init i to 0 if global context; to 1 to skip empty global context) */
if (NULL == p->cvlist) return;
for (int i = !p->cvlist[0].v.u2[1], used = p->nconfig; i < used; ++i) {
const config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0];
for (; cpv->k_id != -1; ++cpv) {
if (cpv->k_id != 0) continue; /* k_id == 0 for ssl.pemfile */

@ -365,7 +365,9 @@ TRIGGER_FUNC(mod_vhostdb_periodic)
/* future: might construct array of (vhostdb_cache *) at startup
* to avoid the need to search for them here */
for (int i = 0, used = p->nconfig; i < used; ++i) {
/* (init i to 0 if global context; to 1 to skip empty global context) */
if (NULL == p->cvlist) return HANDLER_GO_ON;
for (int i = !p->cvlist[0].v.u2[1], used = p->nconfig; i < used; ++i) {
const config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0];
for (; cpv->k_id != -1; ++cpv) {
if (cpv->k_id != 1) continue; /* k_id == 1 for vhostdb.cache */

@ -1485,7 +1485,9 @@ mod_openssl_refresh_stapling_files (server *srv, const plugin_data *p, const tim
{
/* future: might construct array of (plugin_cert *) at startup
* to avoid the need to search for them here */
for (int i = 0, used = p->nconfig; i < used; ++i) {
/* (init i to 0 if global context; to 1 to skip empty global context) */
if (NULL == p->cvlist) return;
for (int i = !p->cvlist[0].v.u2[1], used = p->nconfig; i < used; ++i) {
const config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0];
for (; cpv->k_id != -1; ++cpv) {
if (cpv->k_id != 0) continue; /* k_id == 0 for ssl.pemfile */

Loading…
Cancel
Save