]> git.sur5r.net Git - openldap/commitdiff
Add c_protocol to slap_conn to track protocol version used by client.
authorKurt Zeilenga <kurt@openldap.org>
Thu, 21 Jan 1999 02:21:39 +0000 (02:21 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 21 Jan 1999 02:21:39 +0000 (02:21 +0000)
Is initialized to 0 (unknown) and then set to 2 or 3 on bind.  Should
also be 0->3 if a special (or any) operation occurs before the bind.

servers/slapd/bind.c
servers/slapd/result.c
servers/slapd/slap.h

index aed9559ffa2d84210873d5242c616661e0e835ee..b7b3aba388864ef2c1153f80d7220b12f59d9f08 100644 (file)
@@ -135,6 +135,8 @@ do_bind(
                        free( cred.bv_val );
                }
 
+               conn->c_protocol = version;
+
                send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL );
                return;
        }
@@ -152,6 +154,7 @@ do_bind(
                        free( cred.bv_val );
                }
                if ( cred.bv_len == 0 ) {
+                       conn->c_protocol = version;
                        send_ldap_result( conn, op, LDAP_SUCCESS,
                                NULL, NULL );
                } else if ( default_referral && *default_referral ) {
@@ -173,6 +176,8 @@ do_bind(
                if ( (*be->be_bind)( be, conn, op, ndn, method, &cred, &edn ) == 0 ) {
                        pthread_mutex_lock( &conn->c_dnmutex );
 
+                       conn->c_protocol = version;
+
                        if ( conn->c_cdn != NULL ) {
                                free( conn->c_cdn );
                        }
index 12e90a805b2e8f514934538d2b80bfabf330a1bd..af4498bc9f41d300d220800eadb58c5f41a31842 100644 (file)
@@ -455,6 +455,7 @@ close_connection( Connection *conn, int opconnid, int opid )
                close( conn->c_sb.sb_sd );
                conn->c_sb.sb_sd = -1;
                conn->c_version = 0;
+               conn->c_protocol = 0;
        }
        pthread_mutex_unlock( &new_conn_mutex );
 }
index 45dc21212245f5892b3664e66abcebfa720c7014..3be752ae24019e67fb4100013c065207f51902ad 100644 (file)
@@ -319,6 +319,7 @@ typedef struct slap_conn {
        char            *c_cdn;         /* DN provided by the client */
        char            *c_dn;          /* DN bound to this conn  */
        pthread_mutex_t c_dnmutex;      /* mutex for c_dn field           */
+       int             c_protocol;     /* version of the LDAP protocol used by client */
        int             c_authtype;     /* auth method used to bind c_dn  */
 #ifdef LDAP_COMPAT
        int             c_version;      /* for compatibility w/2.0, 3.0   */