return 0;
}
+static Syntax *syn_UUID;
+
/*
* Turn an URL representing a formerly cached query into a cached query,
* and try to cache it
for ( i = 0; lud->lud_exts[ i ] != NULL; i++ ) {
if ( strncmp( lud->lud_exts[ i ], "x-uuid=", STRLENOF( "x-uuid=" ) ) == 0 ) {
- ber_str2bv( &lud->lud_exts[ i ][ STRLENOF( "x-uuid=" ) ], 0, 0, &uuid );
- if ( rc ) {
+ struct berval tmpUUID;
+ ber_str2bv( &lud->lud_exts[ i ][ STRLENOF( "x-uuid=" ) ], 0, 0, &tmpUUID );
+ assert( syn_UUID->ssyn_pretty != NULL );
+ rc = syn_UUID->ssyn_pretty( syn_UUID, &tmpUUID, &uuid, NULL );
+ if ( rc != LDAP_SUCCESS ) {
goto error;
}
got_uuid = 1;
cq = add_query( op, qm, &query, qt, 1 );
if ( cq != NULL ) {
cq->expiry_time = expiry_time;
- ber_dupbv( &cq->q_uuid, &uuid );
+ cq->q_uuid = uuid;
+
/* it's now into cq->filter */
+ BER_BVZERO( &uuid );
query.filter = NULL;
} else {
if ( query.filter != NULL ) filter_free( query.filter );
if ( !BER_BVISNULL( &tempstr ) ) ch_free( tempstr.bv_val );
if ( !BER_BVISNULL( &query.base ) ) ch_free( query.base.bv_val );
+ if ( !BER_BVISNULL( &uuid ) ) ch_free( uuid.bv_val );
if ( lud != NULL ) ldap_free_urldesc( lud );
return rc;
}
}
+ syn_UUID = syn_find( "1.3.6.1.1.16.1 ");
+ if ( syn_UUID == NULL ) {
+ Debug( LDAP_DEBUG_ANY,
+ "pcache_initialize: unable to find UUID syntax\n",
+ 0, 0, 0 );
+ return LDAP_OTHER;
+ }
+
pcache.on_bi.bi_type = "pcache";
pcache.on_bi.bi_obsolete_names = obsolete_names;
pcache.on_bi.bi_db_init = pcache_db_init;