diff options
| author | Noriko Hosoi <nhosoi@kiki.usersys.redhat.com> | 2009-05-28 09:55:06 -0700 |
|---|---|---|
| committer | Noriko Hosoi <nhosoi@kiki.usersys.redhat.com> | 2009-05-28 09:55:06 -0700 |
| commit | 67aca96ae2c53f74f896439840a82cbccbeb34cf (patch) | |
| tree | ba1da5996985d5990ca5cb13db118983e6b85b2c /ldap/servers/plugins/syntaxes | |
| parent | 586da77caf36591a261506e89dcc9e6a4db00036 (diff) | |
| download | ds-67aca96ae2c53f74f896439840a82cbccbeb34cf.tar.gz ds-67aca96ae2c53f74f896439840a82cbccbeb34cf.tar.xz ds-67aca96ae2c53f74f896439840a82cbccbeb34cf.zip | |
Use thread aware library for complex regex searches
For more details, see the design doc at http://directory.fedoraproject.org/wiki/Thread_Aware_Regex
Additional 2 unrelated changes are being made:
1) dbgen.pl.in: secretary and manager are having a dn format value "cn=...".
2) slapi_counter_sunos_sparcv9.S: adding "#define _ASM 1" to force to set an assembler code macro _ASM.
Diffstat (limited to 'ldap/servers/plugins/syntaxes')
| -rw-r--r-- | ldap/servers/plugins/syntaxes/string.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ldap/servers/plugins/syntaxes/string.c b/ldap/servers/plugins/syntaxes/string.c index 138d98af..218cc762 100644 --- a/ldap/servers/plugins/syntaxes/string.c +++ b/ldap/servers/plugins/syntaxes/string.c @@ -208,7 +208,8 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final, time_t time_up = 0; time_t optime = 0; /* time op was initiated */ int timelimit = 0; /* search timelimit */ - Operation *op = NULL; + Operation *op = NULL; + Slapi_Regex *re = NULL; LDAPDebug( LDAP_DEBUG_FILTER, "=> string_filter_sub\n", 0, 0, 0 ); @@ -284,10 +285,11 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final, /* compile the regex */ p = (bigpat) ? bigpat : pat; - slapd_re_lock(); - if ( (tmpbuf = slapd_re_comp( p )) != 0 ) { + tmpbuf = NULL; + re = slapi_re_comp( p, &tmpbuf ); + if (NULL == re) { LDAPDebug( LDAP_DEBUG_ANY, "re_comp (%s) failed (%s): %s\n", - pat, p, tmpbuf ); + pat, p, tmpbuf?tmpbuf:"unknown" ); rc = LDAP_OPERATIONS_ERROR; goto bailout; } else { @@ -326,7 +328,7 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final, } value_normalize( realval, syntax, 1 /* trim leading blanks */ ); - tmprc = slapd_re_exec( realval, time_up ); + tmprc = slapi_re_exec( re, realval, time_up ); LDAPDebug( LDAP_DEBUG_TRACE, "re_exec (%s) %i\n", escape_string( realval, ebuf ), tmprc, 0 ); @@ -339,7 +341,7 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final, } } bailout: - slapd_re_unlock(); + slapi_re_free(re); slapi_ch_free((void**)&tmpbuf ); /* NULL is fine */ slapi_ch_free((void**)&bigpat ); /* NULL is fine */ |
