Browse Source

[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 3 months ago
parent
commit
33e400b429
  1. 4
      src/mod_auth.c
  2. 4
      src/mod_gnutls.c
  3. 4
      src/mod_nss.c
  4. 4
      src/mod_openssl.c
  5. 4
      src/mod_vhostdb.c
  6. 4
      src/mod_wolfssl.c

4
src/mod_auth.c

@ -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 */

4
src/mod_gnutls.c

@ -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 */

4
src/mod_nss.c

@ -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 */

4
src/mod_openssl.c

@ -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 */

4
src/mod_vhostdb.c

@ -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 */

4
src/mod_wolfssl.c

@ -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