Skip to content

Commit

Permalink
memcache: correct dead server check; see #1230; thanks @rpluem-vf
Browse files Browse the repository at this point in the history
on APR_NOTFOUND

Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Jun 18, 2024
1 parent 28557c1 commit 30d9a55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
06/18/2024
- memcache: correct dead server check on APR_NOTFOUND; see #1230; thanks @rpluem-vf

06/08/2024
- support DPoP nonces to the userinfo endpoint

Expand Down
11 changes: 6 additions & 5 deletions src/cache/memcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,12 @@ static char *oidc_cache_memcache_get_key(apr_pool_t *pool, const char *section,
* check dead/alive status for all servers
*/
static apr_byte_t oidc_cache_memcache_status(request_rec *r, oidc_cache_cfg_memcache_t *context) {
int rc = TRUE;
int i;
for (i = 0; rc && i < context->cache_memcache->ntotal; i++)
rc = rc && (context->cache_memcache->live_servers[0]->status != APR_MC_SERVER_DEAD);
return rc;
int i = 0;
for (i = 0; i < context->cache_memcache->ntotal; i++) {
if (context->cache_memcache->live_servers[i]->status != APR_MC_SERVER_DEAD)
return TRUE;
}
return FALSE;
}

/*
Expand Down

0 comments on commit 30d9a55

Please sign in to comment.