]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/syncrepl.c
reduce code duplication
[openldap] / servers / slapd / syncrepl.c
index 313fb93e38acf50517a19ee5e4947653e0a962ae..8e54357aee7310e326365a3ef0f8042b724173dd 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2009 The OpenLDAP Foundation.
+ * Copyright 2003-2010 The OpenLDAP Foundation.
  * Portions Copyright 2003 by IBM Corporation.
  * Portions Copyright 2003-2008 by Howard Chu, Symas Corporation.
  * All rights reserved.
@@ -810,7 +810,7 @@ do_syncrep2(
                        ldap_get_entry_controls( si->si_ld, msg, &rctrls );
                        /* we can't work without the control */
                        if ( rctrls ) {
-                               LDAPControl **next;
+                               LDAPControl **next = NULL;
                                /* NOTE: make sure we use the right one;
                                 * a better approach would be to run thru
                                 * the whole list and take care of all */
@@ -998,7 +998,7 @@ do_syncrep2(
                                        si->si_ridtxt, err, ldap_err2string( err ) );
                        }
                        if ( rctrls ) {
-                               LDAPControl **next;
+                               LDAPControl **next = NULL;
                                /* NOTE: make sure we use the right one;
                                 * a better approach would be to run thru
                                 * the whole list and take care of all */
@@ -4060,6 +4060,10 @@ parse_syncrepl_line(
                {
                        val = c->argv[ i ] + STRLENOF( PROVIDERSTR "=" );
                        ber_str2bv( val, 0, 1, &si->si_bindconf.sb_uri );
+#ifdef HAVE_TLS
+                       if ( ldap_is_ldaps_url( val ))
+                               si->si_bindconf.sb_tls_do_init = 1;
+#endif
                        si->si_got |= GOT_PROVIDER;
                } else if ( !strncasecmp( c->argv[ i ], SCHEMASTR "=",
                                        STRLENOF( SCHEMASTR "=" ) ) )