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.
This commit is contained in:
Patrik Weiskircher
2014-12-23 10:46:20 -05:00
parent a471062903
commit 95d64f0797
+6 -2
View File
@@ -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);
}