int ldap_parse_passwd(
LDAP *ld,
LDAPMessage *res,
- struct berval **newpasswd )
+ struct berval *newpasswd )
{
int rc;
char *retoid = NULL;
assert( res != NULL );
assert( newpasswd != NULL );
- *newpasswd = NULL;
+ newpasswd->bv_val = NULL;
+ newpasswd->bv_len = 0;
rc = ldap_parse_extended_result( ld, res, &retoid, &retdata, 0 );
ber_printf( ber, "{" /*}*/ );
if( user != NULL ) {
- ber_printf( ber, "ts",
+ ber_printf( ber, "tO",
LDAP_TAG_EXOP_MODIFY_PASSWD_ID, user );
}
if( oldpw != NULL ) {
- ber_printf( ber, "ts",
+ ber_printf( ber, "tO",
LDAP_TAG_EXOP_MODIFY_PASSWD_OLD, oldpw );
}
if( newpw != NULL ) {
- ber_printf( ber, "ts",
+ ber_printf( ber, "tO",
LDAP_TAG_EXOP_MODIFY_PASSWD_NEW, newpw );
}
struct berval *user,
struct berval *oldpw,
struct berval *newpw,
- struct berval **newpasswd,
+ struct berval *newpasswd,
LDAPControl **sctrls,
LDAPControl **cctrls )
{
LDAP_STAILQ_INSERT_TAIL(&pool->ltp_pending_list, ctx, ltc_next.q);
ldap_pvt_thread_cond_signal(&pool->ltp_cond);
if ((pool->ltp_open_count <= 0
+#if 0
|| pool->ltp_pending_count > 1
+#endif
|| pool->ltp_open_count == pool->ltp_active_count)
&& (pool->ltp_max_count <= 0
|| pool->ltp_open_count < pool->ltp_max_count))
pool->ltp_state = run_pending
? LDAP_INT_THREAD_POOL_FINISHING
: LDAP_INT_THREAD_POOL_STOPPING;
- waiting = pool->ltp_open_count;
- /* broadcast could be used here, but only after
- * it is fixed in the NT thread implementation
- */
- while (--waiting >= 0) {
- ldap_pvt_thread_cond_signal(&pool->ltp_cond);
- }
+ ldap_pvt_thread_cond_broadcast(&pool->ltp_cond);
ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex);
do {
ctx->ltc_start_routine(ctx, ctx->ltc_arg);
ldap_pvt_thread_mutex_lock(&pool->ltp_mutex);
+ LDAP_SLIST_REMOVE(&pool->ltp_active_list, ctx,
+ ldap_int_thread_ctx_s, ltc_next.al);
LDAP_SLIST_INSERT_HEAD(&pool->ltp_free_list, ctx, ltc_next.l);
+ pool->ltp_active_count--;
ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex);
ldap_pvt_thread_yield();
*/
ldap_pvt_thread_mutex_lock(&pool->ltp_mutex);
- pool->ltp_active_count--;
- ctx = LDAP_SLIST_FIRST(&pool->ltp_active_list);
- if (ctx) {
- LDAP_SLIST_REMOVE_HEAD(&pool->ltp_active_list, ltc_next.al);
- }
}
pool->ltp_open_count--;