mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
more ber_*cmp optimizations
This commit is contained in:
parent
b48c355934
commit
52b05a5b06
@ -78,7 +78,10 @@ ber_pvt_socket_set_nonblock LDAP_P(( ber_socket_t sd, int nb ));
|
|||||||
? 1 : strncasecmp((v1)->bv_val, (v2)->bv_val, (v1)->bv_len) ))
|
? 1 : strncasecmp((v1)->bv_val, (v2)->bv_val, (v1)->bv_len) ))
|
||||||
|
|
||||||
#define ber_bvccmp(v1,c) \
|
#define ber_bvccmp(v1,c) \
|
||||||
( (v1)->bv_len == 1 && (v1)->bv_val[0] == c )
|
( (v1)->bv_len == 1 && (v1)->bv_val[0] == (c) )
|
||||||
|
|
||||||
|
#define ber_strccmp(s,c) \
|
||||||
|
((s)[1] == '\0' && (s)[0] == (c) )
|
||||||
|
|
||||||
LDAP_END_DECL
|
LDAP_END_DECL
|
||||||
|
|
||||||
|
@ -614,7 +614,7 @@ acl_mask(
|
|||||||
b->a_sockurl_pat, 0, 0 );
|
b->a_sockurl_pat, 0, 0 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( strcmp( b->a_sockurl_pat, "*" ) != 0) {
|
if ( ber_strccmp( b->a_sockurl_pat, '*' ) != 0) {
|
||||||
if ( b->a_sockurl_style == ACL_STYLE_REGEX) {
|
if ( b->a_sockurl_style == ACL_STYLE_REGEX) {
|
||||||
if (!regex_matches( b->a_sockurl_pat, conn->c_listener_url,
|
if (!regex_matches( b->a_sockurl_pat, conn->c_listener_url,
|
||||||
e->e_ndn, matches ) )
|
e->e_ndn, matches ) )
|
||||||
@ -637,7 +637,7 @@ acl_mask(
|
|||||||
Debug( LDAP_DEBUG_ACL, "<= check a_domain_pat: %s\n",
|
Debug( LDAP_DEBUG_ACL, "<= check a_domain_pat: %s\n",
|
||||||
b->a_domain_pat, 0, 0 );
|
b->a_domain_pat, 0, 0 );
|
||||||
#endif
|
#endif
|
||||||
if ( strcmp( b->a_domain_pat, "*" ) != 0) {
|
if ( ber_strccmp( b->a_domain_pat, '*' ) != 0) {
|
||||||
if ( b->a_domain_style == ACL_STYLE_REGEX) {
|
if ( b->a_domain_style == ACL_STYLE_REGEX) {
|
||||||
if (!regex_matches( b->a_domain_pat, conn->c_peer_domain,
|
if (!regex_matches( b->a_domain_pat, conn->c_peer_domain,
|
||||||
e->e_ndn, matches ) )
|
e->e_ndn, matches ) )
|
||||||
@ -660,7 +660,7 @@ acl_mask(
|
|||||||
Debug( LDAP_DEBUG_ACL, "<= check a_peername_path: %s\n",
|
Debug( LDAP_DEBUG_ACL, "<= check a_peername_path: %s\n",
|
||||||
b->a_peername_pat, 0, 0 );
|
b->a_peername_pat, 0, 0 );
|
||||||
#endif
|
#endif
|
||||||
if ( strcmp( b->a_peername_pat, "*" ) != 0) {
|
if ( ber_strccmp( b->a_peername_pat, '*' ) != 0) {
|
||||||
if ( b->a_peername_style == ACL_STYLE_REGEX) {
|
if ( b->a_peername_style == ACL_STYLE_REGEX) {
|
||||||
if (!regex_matches( b->a_peername_pat, conn->c_peer_name,
|
if (!regex_matches( b->a_peername_pat, conn->c_peer_name,
|
||||||
e->e_ndn, matches ) )
|
e->e_ndn, matches ) )
|
||||||
@ -683,7 +683,7 @@ acl_mask(
|
|||||||
Debug( LDAP_DEBUG_ACL, "<= check a_sockname_path: %s\n",
|
Debug( LDAP_DEBUG_ACL, "<= check a_sockname_path: %s\n",
|
||||||
b->a_sockname_pat, 0, 0 );
|
b->a_sockname_pat, 0, 0 );
|
||||||
#endif
|
#endif
|
||||||
if ( strcmp( b->a_sockname_pat, "*" ) != 0) {
|
if ( ber_strccmp( b->a_sockname_pat, '*' ) != 0) {
|
||||||
if ( b->a_sockname_style == ACL_STYLE_REGEX) {
|
if ( b->a_sockname_style == ACL_STYLE_REGEX) {
|
||||||
if (!regex_matches( b->a_sockname_pat, conn->c_sock_name,
|
if (!regex_matches( b->a_sockname_pat, conn->c_sock_name,
|
||||||
e->e_ndn, matches ) )
|
e->e_ndn, matches ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user