]> git.sur5r.net Git - openldap/commitdiff
Clean up CLDAP stuff
authorHoward Chu <hyc@openldap.org>
Fri, 28 Sep 2001 22:19:51 +0000 (22:19 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 28 Sep 2001 22:19:51 +0000 (22:19 +0000)
libraries/libldap/init.c
libraries/libldap/ldap-int.h
libraries/libldap/open.c

index 54c6ba5a4d1f4aa9f96dd1c9464819a97951631f..8c453154ae5acd7e21bb4b4e3c7a209dccb90ce5 100644 (file)
@@ -399,6 +399,7 @@ void ldap_int_initialize_global_options( struct ldapoptions *gopts, int *dbglvl
 #ifdef LDAP_CONNECTIONLESS
        gopts->ldo_peer = NULL;
        gopts->ldo_cldapdn = NULL;
+       gopts->ldo_is_udp = 0;
 #endif
 
 #ifdef HAVE_CYRUS_SASL
index fffaa610eca65f046da4d50c168ddbe3ad9d38cd..971412b26051bb901b53435b95469a0a94eb1aee 100644 (file)
@@ -119,10 +119,10 @@ struct ldapoptions {
 #define LDAP_INITIALIZED       0x1
 #define LDAP_VALID_SESSION     0x2
 #ifdef LDAP_CONNECTIONLESS
-#define        LDAP_UDP_SESSION        0x4
-#define        LDAP_IS_UDP(ld)         (ld->ld_options.ldo_valid & LDAP_UDP_SESSION)
+#define        LDAP_IS_UDP(ld)         ((ld)->ld_options.ldo_is_udp)
        void*                   ldo_peer;       /* struct sockaddr* */
        char*                   ldo_cldapdn;
+       int                     ldo_is_udp;
 #endif
 
        int             ldo_debug;
@@ -301,7 +301,7 @@ struct ldap {
        LDAPConn        *ld_conns;      /* list of server connections */
        void            *ld_selectinfo; /* platform specifics for select */
 };
-#define LDAP_VALID(ld) ( (ld)->ld_valid & LDAP_VALID_SESSION )
+#define LDAP_VALID(ld) ( (ld)->ld_valid == LDAP_VALID_SESSION )
 
 #ifdef LDAP_R_COMPILE
 #include <ldap_pvt_thread.h>
index 2010e83026bdb944ef3b666a69930162aef6a37c..a634cce5a79d1ab6cc870c25fb9c5890209e11b6 100644 (file)
@@ -238,7 +238,7 @@ ldap_initialize( LDAP **ldp, LDAP_CONST char *url )
                }
 #ifdef LDAP_CONNECTIONLESS
                if (ldap_is_ldapc_url(url))
-                       ld->ld_options.ldo_valid |= LDAP_UDP_SESSION;
+                       LDAP_IS_UDP(ld) = 1;
 #endif
        }
 
@@ -303,7 +303,7 @@ ldap_int_open_connection(
                        } else {
                                host = srv->lud_host;
                        }
-                       ld->ld_options.ldo_valid |= LDAP_UDP_SESSION;
+                       LDAP_IS_UDP(ld) = 1;
                        rc = ldap_connect_to_host( ld, conn->lconn_sb,
                                proto, host, addr, port, async );