Skip to content
Snippets Groups Projects
Commit 6b035aac authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

work around the last issue: some times the result times out while the other...

work around the last issue: some times the result times out while the other party is not willing to send any response; give it a second chance
parent 842b5ce0
No related branches found
No related tags found
No related merge requests found
......@@ -314,7 +314,9 @@ meta_back_single_dobind(
metasingleconn_t *msc = &mc->mc_conns[ candidate ];
int rc;
struct berval cred = BER_BVC( "" );
int msgid;
int msgid,
rebinding = 0,
save_nretries = nretries;
/*
* Otherwise an anonymous bind is performed
......@@ -362,7 +364,17 @@ retry:;
}
rc = LDAP_BUSY;
break;
if ( rebinding ) {
break;
}
/* FIXME: some times the request times out
* while the other party is not willing to
* send a response any more. Give it a second
* chance with a freshly bound connection */
rebinding = 1;
nretries = save_nretries;
/* fallthru */
case -1:
ldap_get_option( msc->msc_ld,
......
......@@ -837,9 +837,12 @@ suffix_massage_regexize( const char *s )
p = r + 1, i++ )
;
res = ch_calloc( sizeof( char ), strlen( s ) + 4 + 4*i + 1 );
res = ch_calloc( sizeof( char ),
strlen( s )
+ STRLENOF( "(.+,)?" )
+ STRLENOF( "[ ]?" ) * i + 1 );
ptr = lutil_strcopy( res, "(.*)" );
ptr = lutil_strcopy( res, "(.+,)?" );
for ( i = 0, p = s;
( r = strchr( p, ',' ) ) != NULL;
p = r + 1 , i++ ) {
......@@ -863,13 +866,13 @@ suffix_massage_patternize( const char *s )
len = strlen( s );
res = ch_calloc( sizeof( char ), len + sizeof( "%1" ) );
res = ch_calloc( sizeof( char ), len + STRLENOF( "%1" ) + 1 );
if ( res == NULL ) {
return NULL;
}
strcpy( res, "%1" );
strcpy( res + sizeof( "%1" ) - 1, s );
strcpy( &res[ STRLENOF( "%1" ) ], s );
return res;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment