mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
Minor cleanup
This commit is contained in:
parent
89da861b89
commit
b7d1b10bca
@ -231,9 +231,9 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit )
|
||||
|
||||
if ( sb->sb_debug ) {
|
||||
ber_log_printf( LDAP_DEBUG_ANY, sb->sb_debug,
|
||||
"ber_flush: %ld bytes to sd %ld%s\n", towrite,
|
||||
(long) sb->sb_fd, ber->ber_rwptr != ber->ber_buf ?
|
||||
" (re-flush)" : "" );
|
||||
"ber_flush: %ld bytes to sd %ld%s\n",
|
||||
towrite, (long) sb->sb_fd,
|
||||
ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" );
|
||||
ber_log_bprint( LDAP_DEBUG_PACKETS, sb->sb_debug,
|
||||
ber->ber_rwptr, towrite );
|
||||
}
|
||||
@ -523,8 +523,10 @@ ber_get_next(
|
||||
}
|
||||
do {
|
||||
/* reading the tag... */
|
||||
if (ber_int_sb_read( sb, ber->ber_rwptr, 1)<=0)
|
||||
if (ber_int_sb_read( sb, ber->ber_rwptr, 1)<=0) {
|
||||
return LBER_DEFAULT;
|
||||
}
|
||||
|
||||
if (! (ber->ber_rwptr[0] & LBER_MORE_TAG_MASK) ) {
|
||||
ber->ber_tag>>=sizeof(ber->ber_tag) -
|
||||
((char *) &ber->ber_tag - ber->ber_rwptr);
|
||||
@ -532,6 +534,7 @@ ber_get_next(
|
||||
goto get_lenbyte;
|
||||
}
|
||||
} while( PTR_IN_VAR(ber->ber_rwptr, ber->ber_tag ));
|
||||
|
||||
errno = ERANGE; /* this is a serious error. */
|
||||
return LBER_DEFAULT;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ do_add( Connection *conn, Operation *op )
|
||||
e->e_attrs = NULL;
|
||||
e->e_private = NULL;
|
||||
|
||||
Debug( LDAP_DEBUG_ARGS, " do_add: ndn (%s)\n", e->e_ndn, 0, 0 );
|
||||
Debug( LDAP_DEBUG_ARGS, "do_add: ndn (%s)\n", e->e_ndn, 0, 0 );
|
||||
|
||||
/* get the attrs */
|
||||
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
|
||||
|
@ -975,9 +975,9 @@ connection_input(
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
if ( (tag = ber_get_next( conn->c_sb, &len, conn->c_currentber ))
|
||||
!= LDAP_TAG_MESSAGE )
|
||||
{
|
||||
|
||||
tag = ber_get_next( conn->c_sb, &len, conn->c_currentber );
|
||||
if ( tag != LDAP_TAG_MESSAGE ) {
|
||||
int err = errno;
|
||||
ber_socket_t sd;
|
||||
|
||||
|
@ -137,18 +137,21 @@ dn_validate( char *dn )
|
||||
*d++ = *s;
|
||||
}
|
||||
break;
|
||||
|
||||
case B4SEPARATOR:
|
||||
if ( RDN_SEPARATOR( *s ) ) {
|
||||
state = B4TYPE;
|
||||
*d++ = *s;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
dn = NULL;
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"dn_validate - unknown state %d\n", state, 0, 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( *s == '\\' ) {
|
||||
gotesc = 1;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user