mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-11 13:50:39 +08:00
don't bother about the port if none is given (ITS#4012)
This commit is contained in:
parent
3093f97767
commit
daa7b11ff5
@ -459,7 +459,7 @@ parse_replica_line(
|
||||
ri->ri_port = atoi( hp );
|
||||
}
|
||||
if ( ri->ri_port <= 0 ) {
|
||||
ri->ri_port = 0;
|
||||
ri->ri_port = LDAP_PORT;
|
||||
}
|
||||
ri->ri_hostname = strdup( val );
|
||||
gots |= GOT_HOST;
|
||||
|
@ -321,7 +321,7 @@ get_repl_hosts(
|
||||
if ( ldif_parse_line( line, &type, &value, &len ) < 0 ) {
|
||||
return( NULL );
|
||||
}
|
||||
port = 0;
|
||||
port = LDAP_PORT;
|
||||
if (( p = strchr( value, ':' )) != NULL ) {
|
||||
*p = '\0';
|
||||
p++;
|
||||
@ -544,11 +544,18 @@ Re_write(
|
||||
}
|
||||
|
||||
if ( ri != NULL ) { /* write a single "replica:" line */
|
||||
if ( fprintf( fp, "replica: %s:%d\n", ri->ri_hostname,
|
||||
ri->ri_port ) < 0 ) {
|
||||
if ( ri->ri_port != 0 ) {
|
||||
rc = fprintf( fp, "replica: %s:%d\n", ri->ri_hostname,
|
||||
ri->ri_port );
|
||||
} else {
|
||||
rc = fprintf( fp, "replica: %s\n", ri->ri_hostname );
|
||||
}
|
||||
if ( rc < 0 ) {
|
||||
rc = -1;
|
||||
goto bad;
|
||||
}
|
||||
rc = 0;
|
||||
|
||||
} else { /* write multiple "replica:" lines */
|
||||
for ( i = 0; re->re_replicas && re->re_replicas[ i ].rh_hostname != NULL; i++ ) {
|
||||
if ( fprintf( fp, "replica: %s:%d\n",
|
||||
|
@ -52,7 +52,7 @@ replicate(
|
||||
Ri *ri = (Ri *) ri_arg;
|
||||
|
||||
Debug( LDAP_DEBUG_ARGS, "begin replication thread for %s:%d\n",
|
||||
((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
|
||||
ri->ri_hostname, ri->ri_port, 0 );
|
||||
|
||||
ri->ri_process( ri );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user