Lines Matching refs:ld
46 ldap_unbind( LDAP *ld ) in ldap_unbind() argument
50 return( ldap_ld_free( ld, NULL, NULL, 1 ) ); in ldap_unbind()
56 ldap_unbind_s( LDAP *ld ) in ldap_unbind_s() argument
58 return( ldap_ld_free( ld, NULL, NULL, 1 )); in ldap_unbind_s()
64 ldap_unbind_ext( LDAP *ld, LDAPControl **serverctrls, in ldap_unbind_ext() argument
67 return( ldap_ld_free( ld, serverctrls, clientctrls, 1 )); in ldap_unbind_ext()
76 ldap_ld_free( LDAP *ld, LDAPControl **serverctrls, in ldap_ld_free() argument
83 if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) { in ldap_ld_free()
87 if ( ld->ld_sbp->sb_naddr == 0 ) { in ldap_ld_free()
88 LDAP_MUTEX_LOCK( ld, LDAP_REQ_LOCK ); in ldap_ld_free()
90 for ( lr = ld->ld_requests; lr != NULL; lr = nextlr ) { in ldap_ld_free()
92 nsldapi_free_request( ld, lr, 0 ); in ldap_ld_free()
94 LDAP_MUTEX_UNLOCK( ld, LDAP_REQ_LOCK ); in ldap_ld_free()
97 LDAP_MUTEX_LOCK( ld, LDAP_CONN_LOCK ); in ldap_ld_free()
98 while ( ld->ld_conns != NULL ) { in ldap_ld_free()
99 nsldapi_free_connection( ld, ld->ld_conns, serverctrls, in ldap_ld_free()
102 LDAP_MUTEX_UNLOCK( ld, LDAP_CONN_LOCK ); in ldap_ld_free()
107 for ( i = 0; i < ld->ld_sbp->sb_naddr; ++i ) { in ldap_ld_free()
108 NSLDAPI_FREE( ld->ld_sbp->sb_addrs[ i ] ); in ldap_ld_free()
110 NSLDAPI_FREE( ld->ld_sbp->sb_addrs ); in ldap_ld_free()
111 NSLDAPI_FREE( ld->ld_sbp->sb_fromaddr ); in ldap_ld_free()
114 LDAP_MUTEX_LOCK( ld, LDAP_RESP_LOCK ); in ldap_ld_free()
115 for ( lm = ld->ld_responses; lm != NULL; lm = next ) { in ldap_ld_free()
119 LDAP_MUTEX_UNLOCK( ld, LDAP_RESP_LOCK ); in ldap_ld_free()
122 if ( ld->ld_cache_unbind != NULL ) { in ldap_ld_free()
123 LDAP_MUTEX_LOCK( ld, LDAP_CACHE_LOCK ); in ldap_ld_free()
124 (void)ld->ld_cache_unbind( ld, 0, 0 ); in ldap_ld_free()
125 LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK ); in ldap_ld_free()
129 if ( ld->ld_extdisposehandle_fn != NULL ) { in ldap_ld_free()
134 ld->ld_extdisposehandle_fn( ld, ld->ld_ext_session_arg ); in ldap_ld_free()
137 if ( ld->ld_error != NULL ) in ldap_ld_free()
138 NSLDAPI_FREE( ld->ld_error ); in ldap_ld_free()
139 if ( ld->ld_matched != NULL ) in ldap_ld_free()
140 NSLDAPI_FREE( ld->ld_matched ); in ldap_ld_free()
141 if ( ld->ld_host != NULL ) in ldap_ld_free()
142 NSLDAPI_FREE( ld->ld_host ); in ldap_ld_free()
143 if ( ld->ld_ufnprefix != NULL ) in ldap_ld_free()
144 NSLDAPI_FREE( ld->ld_ufnprefix ); in ldap_ld_free()
145 if ( ld->ld_filtd != NULL ) in ldap_ld_free()
146 ldap_getfilter_free( ld->ld_filtd ); in ldap_ld_free()
147 if ( ld->ld_abandoned != NULL ) in ldap_ld_free()
148 NSLDAPI_FREE( ld->ld_abandoned ); in ldap_ld_free()
149 if ( ld->ld_sbp != NULL ) in ldap_ld_free()
150 ber_sockbuf_free( ld->ld_sbp ); in ldap_ld_free()
151 if ( ld->ld_defhost != NULL ) in ldap_ld_free()
152 NSLDAPI_FREE( ld->ld_defhost ); in ldap_ld_free()
153 if ( ld->ld_servercontrols != NULL ) in ldap_ld_free()
154 ldap_controls_free( ld->ld_servercontrols ); in ldap_ld_free()
155 if ( ld->ld_clientcontrols != NULL ) in ldap_ld_free()
156 ldap_controls_free( ld->ld_clientcontrols ); in ldap_ld_free()
157 if ( ld->ld_preferred_language != NULL ) in ldap_ld_free()
158 NSLDAPI_FREE( ld->ld_preferred_language ); in ldap_ld_free()
159 nsldapi_iostatus_free( ld ); in ldap_ld_free()
161 if ( ld->ld_def_sasl_mech != NULL ) in ldap_ld_free()
162 NSLDAPI_FREE( ld->ld_def_sasl_mech ); in ldap_ld_free()
163 if ( ld->ld_def_sasl_realm != NULL ) in ldap_ld_free()
164 NSLDAPI_FREE( ld->ld_def_sasl_realm ); in ldap_ld_free()
165 if ( ld->ld_def_sasl_authcid != NULL ) in ldap_ld_free()
166 NSLDAPI_FREE( ld->ld_def_sasl_authcid ); in ldap_ld_free()
167 if ( ld->ld_def_sasl_authzid != NULL ) in ldap_ld_free()
168 NSLDAPI_FREE( ld->ld_def_sasl_authzid ); in ldap_ld_free()
174 if ( ld->ld_memcache != NULL ) { in ldap_ld_free()
175 ldap_memcache_set( ld, NULL ); in ldap_ld_free()
179 nsldapi_mutex_free_all( ld ); in ldap_ld_free()
180 NSLDAPI_FREE( ld->ld_mutex ); in ldap_ld_free()
182 NSLDAPI_FREE( (char *) ld ); in ldap_ld_free()
190 nsldapi_send_unbind( LDAP *ld, Sockbuf *sb, LDAPControl **serverctrls, in nsldapi_send_unbind() argument
199 if (( err = nsldapi_alloc_ber_with_options( ld, &ber )) in nsldapi_send_unbind()
205 LDAP_MUTEX_LOCK( ld, LDAP_MSGID_LOCK ); in nsldapi_send_unbind()
206 msgid = ++ld->ld_msgid; in nsldapi_send_unbind()
207 LDAP_MUTEX_UNLOCK( ld, LDAP_MSGID_LOCK ); in nsldapi_send_unbind()
212 LDAP_SET_LDERRNO( ld, err, NULL, NULL ); in nsldapi_send_unbind()
216 if (( err = nsldapi_put_controls( ld, serverctrls, 1, ber )) in nsldapi_send_unbind()
223 if ( nsldapi_ber_flush( ld, sb, ber, 1, 0 ) != 0 ) { in nsldapi_send_unbind()
226 LDAP_SET_LDERRNO( ld, err, NULL, NULL ); in nsldapi_send_unbind()