[libgda] ldap-provider: remove warnings



commit 7a8d01e19d3d85c1273ca25e8025ca591732943e
Author: Daniel Espinosa Ortiz <esodan gmail com>
Date:   Fri Feb 22 13:56:46 2019 -0600

    ldap-provider: remove warnings

 providers/ldap/gda-ldap-util.c | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)
---
diff --git a/providers/ldap/gda-ldap-util.c b/providers/ldap/gda-ldap-util.c
index 68b5ae5c1..ccd31b145 100644
--- a/providers/ldap/gda-ldap-util.c
+++ b/providers/ldap/gda-ldap-util.c
@@ -1474,15 +1474,16 @@ worker_gdaprov_ldap_describe_entry (WorkerLdapDescrEntryData *data, GError **err
                gda_ldap_may_unbind (data->cnc);
                return lentry;
        }
-       case LDAP_SERVER_DOWN: {
-               gint i;
-               for (i = 0; i < 5; i++) {
-                       if (gda_ldap_rebind (data->cnc, NULL))
-                               goto retry;
-                       g_usleep (G_USEC_PER_SEC * 2);
-               }
-       }
+       case LDAP_SERVER_DOWN:
        default: {
+               if (res == LDAP_SERVER_DOWN) {
+                       gint i;
+                       for (i = 0; i < 5; i++) {
+                               if (gda_ldap_rebind (data->cnc, NULL))
+                                       goto retry;
+                               g_usleep (G_USEC_PER_SEC * 2);
+                       }
+               }
                /* error */
                int ldap_errno;
                ldap_get_option (data->cdata->handle, LDAP_OPT_ERROR_NUMBER, &ldap_errno);
@@ -1665,19 +1666,20 @@ worker_gdaprov_ldap_get_entry_children (WorkerEntryChildrenData *data, GError **
                else
                        return NULL;
        }
-       case LDAP_SERVER_DOWN: {
-               gint i;
-               if (msg) {
-                       ldap_msgfree (msg);
-                       msg = NULL;
-               }
-               for (i = 0; i < 5; i++) {
-                       if (gda_ldap_rebind (data->cnc, NULL))
-                               goto retry;
-                       g_usleep (G_USEC_PER_SEC * 2);
-               }
-       }
+       case LDAP_SERVER_DOWN:
        default: {
+               if (res == LDAP_SERVER_DOWN) {
+                       gint i;
+                       if (msg) {
+                               ldap_msgfree (msg);
+                               msg = NULL;
+                       }
+                       for (i = 0; i < 5; i++) {
+                               if (gda_ldap_rebind (data->cnc, NULL))
+                                       goto retry;
+                               g_usleep (G_USEC_PER_SEC * 2);
+                       }
+               }
                /* error */
                int ldap_errno;
                ldap_get_option (data->cdata->handle, LDAP_OPT_ERROR_NUMBER, &ldap_errno);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]