version 1.7.2.3, 1998/12/31 19:32:07
|
version 1.7.2.3.2.1, 2001/05/29 16:41:11
|
Line 280 read1msg( LDAP *ld, int msgid, int all,
|
Line 280 read1msg( LDAP *ld, int msgid, int all,
|
ldap_set_ber_options( ld, &ber ); |
ldap_set_ber_options( ld, &ber ); |
|
|
/* get the next message */ |
/* get the next message */ |
if ( (tag = ber_get_next( sb, &len, &ber )) |
if ( (tag = ber_get_next( sb, &len, &ber )) != LDAP_TAG_MESSAGE ) { |
!= LDAP_TAG_MESSAGE ) { |
ld->ld_errno = (tag == LBER_DEFAULT) |
ld->ld_errno = (tag == LBER_DEFAULT ? LDAP_SERVER_DOWN : |
? LDAP_SERVER_DOWN |
LDAP_LOCAL_ERROR); |
: LDAP_LOCAL_ERROR; |
|
free( ber.ber_buf ); |
return( -1 ); |
return( -1 ); |
} |
} |
|
|
/* message id */ |
/* message id */ |
if ( ber_get_int( &ber, &id ) == LBER_ERROR ) { |
if ( ber_get_int( &ber, &id ) == LBER_ERROR ) { |
ld->ld_errno = LDAP_DECODING_ERROR; |
ld->ld_errno = LDAP_DECODING_ERROR; |
|
free( ber.ber_buf ); |
return( -1 ); |
return( -1 ); |
} |
} |
|
|
/* if it's been abandoned, toss it */ |
/* if it's been abandoned, toss it */ |
if ( ldap_abandoned( ld, (int)id ) ) { |
if ( ldap_abandoned( ld, (int)id ) ) { |
free( ber.ber_buf ); /* gack! */ |
free( ber.ber_buf ); |
return( -2 ); /* continue looking */ |
return( -2 ); /* continue looking */ |
} |
} |
|
|
Line 304 read1msg( LDAP *ld, int msgid, int all,
|
Line 306 read1msg( LDAP *ld, int msgid, int all,
|
Debug( LDAP_DEBUG_ANY, |
Debug( LDAP_DEBUG_ANY, |
"no request for response with msgid %ld (tossing)\n", |
"no request for response with msgid %ld (tossing)\n", |
id, 0, 0 ); |
id, 0, 0 ); |
free( ber.ber_buf ); /* gack! */ |
free( ber.ber_buf ); |
return( -2 ); /* continue looking */ |
return( -2 ); /* continue looking */ |
} |
} |
Debug( LDAP_DEBUG_TRACE, "got %s msgid %ld, original id %d\n", |
Debug( LDAP_DEBUG_TRACE, "got %s msgid %ld, original id %d\n", |
Line 316 read1msg( LDAP *ld, int msgid, int all,
|
Line 318 read1msg( LDAP *ld, int msgid, int all,
|
/* the message type */ |
/* the message type */ |
if ( (tag = ber_peek_tag( &ber, &len )) == LBER_ERROR ) { |
if ( (tag = ber_peek_tag( &ber, &len )) == LBER_ERROR ) { |
ld->ld_errno = LDAP_DECODING_ERROR; |
ld->ld_errno = LDAP_DECODING_ERROR; |
|
free( ber.ber_buf ); |
return( -1 ); |
return( -1 ); |
} |
} |
|
|
Line 372 Debug( LDAP_DEBUG_TRACE,
|
Line 375 Debug( LDAP_DEBUG_TRACE,
|
simple_request = ( hadref ? 0 : 1 ); |
simple_request = ( hadref ? 0 : 1 ); |
} else { |
} else { |
/* request with referrals or child request */ |
/* request with referrals or child request */ |
free( ber.ber_buf ); /* gack! */ |
free( ber.ber_buf ); |
ber.ber_buf = NULL; |
ber.ber_buf = NULL; |
} |
} |
|
|
Line 416 lr->lr_res_matched ? lr->lr_res_matched
|
Line 419 lr->lr_res_matched ? lr->lr_res_matched
|
} |
} |
|
|
if ( ber.ber_buf == NULL ) { |
if ( ber.ber_buf == NULL ) { |
return( rc ); |
return rc; |
} |
} |
|
|
#endif /* LDAP_REFERRALS */ |
#endif /* LDAP_REFERRALS */ |
Line 424 lr->lr_res_matched ? lr->lr_res_matched
|
Line 427 lr->lr_res_matched ? lr->lr_res_matched
|
if ( (new = (LDAPMessage *) calloc( 1, sizeof(LDAPMessage) )) |
if ( (new = (LDAPMessage *) calloc( 1, sizeof(LDAPMessage) )) |
== NULL ) { |
== NULL ) { |
ld->ld_errno = LDAP_NO_MEMORY; |
ld->ld_errno = LDAP_NO_MEMORY; |
|
free( ber.ber_buf ); |
return( -1 ); |
return( -1 ); |
} |
} |
new->lm_msgid = (int)id; |
new->lm_msgid = (int)id; |