From 95d64f0797dc5fddf7488c8d9c8eaff4319ee90b Mon Sep 17 00:00:00 2001 From: Patrik Weiskircher Date: Tue, 23 Dec 2014 10:46:20 -0500 Subject: [PATCH] don't return the connection after every LDAP reply. This makes the connection more sticky to one request and prevents auth timeouts and lost requests. --- ngx_http_auth_ldap_module.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ngx_http_auth_ldap_module.c b/ngx_http_auth_ldap_module.c index 244e9d5..32a4fb3 100644 --- a/ngx_http_auth_ldap_module.c +++ b/ngx_http_auth_ldap_module.c @@ -1014,6 +1014,12 @@ ngx_http_auth_ldap_get_connection(ngx_http_auth_ldap_ctx_t *ctx) ngx_queue_t *q; ngx_http_auth_ldap_connection_t *c; + /* + * If we already have a connection, just say we got them one. + */ + if (ctx->c != NULL) + return 1; + server = ctx->server; ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->r->connection->log, 0, "http_auth_ldap: Wants a free connection to \"%V\"", @@ -1076,8 +1082,6 @@ ngx_http_auth_ldap_reply_connection(ngx_http_auth_ldap_connection_t *c, int erro ctx->error_msg.data = NULL; } - ngx_http_auth_ldap_return_connection(c); - ngx_http_auth_ldap_wake_request(ctx->r); }