mirror of
https://github.com/mainnika/nginx-auth-ldap.git
synced 2026-05-22 15:53:39 +00:00
Fix requests that were waiting on a LDAP connection getting lost and timing out after 10 seconds.
This commit is contained in:
@@ -1591,7 +1591,15 @@ ngx_http_auth_ldap_authenticate(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
if (!ctx->replied && ctx->phase != PHASE_START) {
|
||||
/*
|
||||
* If we are not starting up a request (ctx->phase != PHASE_START) and we actually already
|
||||
* sent a request (ctx->iteration > 0) and didn't receive a reply yet (!ctx->replied) we
|
||||
* ask to be called again at a later time when we hopefully have received a reply.
|
||||
*
|
||||
* It is quite possible that we reach this if while not having sent a request yet (ctx->iteration == 0) -
|
||||
* this happens when we are trying to get an LDAP connection but all of them are busy right now.
|
||||
*/
|
||||
if (ctx->iteration > 0 && !ctx->replied && ctx->phase != PHASE_START) {
|
||||
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http_auth_ldap: The LDAP operation did not finish yet");
|
||||
return NGX_AGAIN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user