From: Pierangelo Masarati Date: Thu, 24 Nov 2005 21:21:27 +0000 (+0000) Subject: use friendly form for timeouts X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~709 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ce367bcc25e56ce7dd707986775e2f24d365ba02;p=openldap use friendly form for timeouts --- diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c index 41b9adfabe..ea78c2037b 100644 --- a/servers/slapd/back-meta/config.c +++ b/servers/slapd/back-meta/config.c @@ -346,6 +346,8 @@ meta_back_db_config( /* network timeout when connecting to ldap servers */ } else if ( strcasecmp( argv[ 0 ], "network-timeout" ) == 0 ) { + unsigned long t; + if ( argc != 2 ) { Debug( LDAP_DEBUG_ANY, "%s: line %d: missing network timeout in \"network-timeout \" line\n", @@ -353,19 +355,16 @@ meta_back_db_config( return 1; } - if ( lutil_atoi( &mi->mi_network_timeout, argv[ 1 ] ) ) { + if ( lutil_parse_time( argv[ 1 ], &t ) ) { Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse timeout \"%s\" in \"network-timeout \" line\n", fname, lineno, argv[ 1 ] ); return 1; - } else if ( mi->mi_network_timeout < 0 ) { - Debug( LDAP_DEBUG_ANY, - "%s: line %d: ilegal negative timeout in \"network-timeout \" line\n", - fname, lineno, argv[ 1 ] ); - return 1; } + mi->mi_network_timeout = (int)t; + /* name to use for meta_back_group */ } else if ( strcasecmp( argv[ 0 ], "acl-authcDN" ) == 0 || strcasecmp( argv[ 0 ], "binddn" ) == 0 )