[SR-Dev] git:janakj/ldap: - use cfg_parse_bool_opt

Jan Janak jan at iptel.org
Fri Feb 13 00:57:05 CET 2009


Module: sip-router
Branch: janakj/ldap
Commit: 1db8e0a7e68c069638c84e0d10f513d59d22e323
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1db8e0a7e68c069638c84e0d10f513d59d22e323

Author: Jan Janak <jan at iptel.org>
Committer: Jan Janak <jan at iptel.org>
Date:   Tue Jul 22 12:32:13 2008 +0000

- use cfg_parse_bool_opt

---

 modules/db_ldap/ld_cfg.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/modules/db_ldap/ld_cfg.c b/modules/db_ldap/ld_cfg.c
index d3758ab..ea3d564 100644
--- a/modules/db_ldap/ld_cfg.c
+++ b/modules/db_ldap/ld_cfg.c
@@ -268,13 +268,13 @@ static cfg_option_t auth_values[] = {
 
 
 static cfg_option_t ldap_con_options[] = {
-	{"host",     		.f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
-	{"port",     		.f = cfg_parse_int_opt},
-	{"username", 		.f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
-	{"password", 		.f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
-	{"authtype", 		.param = auth_values, .f = cfg_parse_enum_opt},
-	{"tls",			.param = cfg_bool_values, .f = cfg_parse_enum_opt},
-	{"ca_list",  		.f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
+	{"host",     		    .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
+	{"port",     		    .f = cfg_parse_int_opt},
+	{"username", 		    .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
+	{"password", 		    .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
+	{"authtype", 		    .param = auth_values, .f = cfg_parse_enum_opt},
+	{"tls",			        .f = cfg_parse_bool_opt},
+	{"ca_list",  		    .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
 	{"require_certificate", .f = cfg_parse_str_opt, .flags = CFG_STR_PKGMEM},
 	{0}
 };
@@ -345,9 +345,7 @@ static int parse_section(void* param, cfg_parser_t* st, unsigned int flags)
 		for(i = 0; auth_values[i].name; i++) {
 			auth_values[i].param = &con->authmech;
 		}
-		for(i = 0; cfg_bool_values[i].name; i++) {
-			cfg_bool_values[i].param = &con->tls;
-		}
+		ldap_con_options[5].param = &con->tls;
 		ldap_con_options[6].param = &con->ca_list;
 		ldap_con_options[7].param = &con->req_cert;
 	} else {




More information about the sr-dev mailing list