From 5d82c4a6e5a9174469a8ccb61b2d61c188f6400f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= Date: Thu, 15 May 2014 19:22:26 +0200 Subject: [PATCH 1/2] Removed recursion during ssl handshake (should fix #34) --- ngx_http_auth_ldap_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ngx_http_auth_ldap_module.c b/ngx_http_auth_ldap_module.c index 3ed2049..ccd4667 100644 --- a/ngx_http_auth_ldap_module.c +++ b/ngx_http_auth_ldap_module.c @@ -1209,7 +1209,7 @@ ngx_http_auth_ldap_ssl_handshake(ngx_http_auth_ldap_connection_t *c) return; } - ngx_http_auth_ldap_ssl_handshake(c); + ngx_http_auth_ldap_ssl_handshake_handler(c); return; } #endif From 930918b6c950835758c8a7d46d48e206acd30147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= Date: Thu, 15 May 2014 19:56:27 +0200 Subject: [PATCH 2/2] Fixed compilation without SSL (fixes #22) --- ngx_http_auth_ldap_module.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ngx_http_auth_ldap_module.c b/ngx_http_auth_ldap_module.c index ccd4667..254d875 100644 --- a/ngx_http_auth_ldap_module.c +++ b/ngx_http_auth_ldap_module.c @@ -186,7 +186,9 @@ static ngx_int_t ngx_http_auth_ldap_check_user(ngx_http_request_t *r, ngx_http_a static ngx_int_t ngx_http_auth_ldap_check_group(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *ctx); static ngx_int_t ngx_http_auth_ldap_check_bind(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *ctx); static ngx_int_t ngx_http_auth_ldap_recover_bind(ngx_http_request_t *r, ngx_http_auth_ldap_ctx_t *ctx); +#if (NGX_OPENSSL) static ngx_int_t ngx_http_auth_ldap_restore_handlers(ngx_connection_t *conn); +#endif ngx_http_auth_ldap_cache_t ngx_http_auth_ldap_cache; @@ -1090,6 +1092,7 @@ ngx_http_auth_ldap_dummy_write_handler(ngx_event_t *wev) } +#if (NGX_OPENSSL) /* Make sure the event hendlers are activated. */ static ngx_int_t ngx_http_auth_ldap_restore_handlers(ngx_connection_t *conn) @@ -1115,6 +1118,7 @@ ngx_http_auth_ldap_restore_handlers(ngx_connection_t *conn) return NGX_OK; } +#endif static void ngx_http_auth_ldap_connection_established(ngx_http_auth_ldap_connection_t *c) @@ -1416,7 +1420,9 @@ ngx_http_auth_ldap_connect(ngx_http_auth_ldap_connection_t *c) conn = pconn->connection; conn->data = c; +#if (NGX_OPENSSL) conn->pool = c->pool; +#endif conn->write->handler = ngx_http_auth_ldap_connect_handler; conn->read->handler = ngx_http_auth_ldap_read_handler; ngx_add_timer(conn->read, 10000); /* TODO: Connect timeout */