int nentries;
int matchlen;
char *matched;
+ int nrefs;
+ struct berval **refs;
} glue_state;
void
gs->matchlen = len;
}
}
+ if (ref) {
+ int i, j, k;
+ struct berval **new;
+
+ for (i=0; ref[i]; i++);
+
+ j = gs->nrefs;
+ if (!j) {
+ new = ch_malloc ((i+1)*sizeof(struct berval *));
+ gs->nrefs = i;
+ } else {
+ new = ch_realloc(gs->refs,
+ (j+i+1)*sizeof(struct berval *));
+ }
+ for (k=0; k<i; j++,k++) {
+ new[j] = ber_bvdup(ref[k]);
+ }
+ new[j] = NULL;
+ gs->nrefs = j;
+ gs->refs = new;
+ }
}
void
BackendDB *be;
int i, rc, t2limit = 0, s2limit = 0;
long stoptime = 0;
- glue_state gs =
- {0};
+ glue_state gs = {0};
if (tlimit)
op->o_response = NULL;
op->o_glue = NULL;
- send_search_result (conn, op, gs.err, gs.matched, NULL, NULL,
+ send_search_result (conn, op, gs.err, gs.matched, NULL, gs.refs,
NULL, gs.nentries);
- done:
+done:
if (gs.matched)
free (gs.matched);
+ if (gs.refs)
+ ber_bvecfree(gs.refs);
return rc;
}