static int wait4msg LDAP_P(( LDAP *ld, ber_int_t msgid, int all, struct timeval *timeout,
LDAPMessage **result ));
static ber_tag_t try_read1msg LDAP_P(( LDAP *ld, ber_int_t msgid,
- int all, Sockbuf *sb, LDAPConn **lc, LDAPMessage **result ));
+ int all, LDAPConn **lc, LDAPMessage **result ));
static ber_tag_t build_result_ber LDAP_P(( LDAP *ld, BerElement **bp, LDAPRequest *lr ));
static void merge_error_info LDAP_P(( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr ));
static LDAPMessage * chkResponseList LDAP_P(( LDAP *ld, int msgid, int all));
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &ld->ld_conn_mutex );
#endif
- rc = try_read1msg( ld, msgid, all, lc->lconn_sb,
- &lc, result );
+ rc = try_read1msg( ld, msgid, all, &lc, result );
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &ld->ld_conn_mutex );
#endif
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &ld->ld_conn_mutex );
#endif
- rc = try_read1msg( ld, msgid, all,
- lc->lconn_sb, &lc, result );
+ rc = try_read1msg( ld, msgid, all, &lc, result );
if ( lc == NULL ) lc = nextlc;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &ld->ld_conn_mutex );
LDAP *ld,
ber_int_t msgid,
int all,
- Sockbuf *sb,
LDAPConn **lcp,
LDAPMessage **result )
{
#ifdef LDAP_CONNECTIONLESS
if ( LDAP_IS_UDP(ld) ) {
struct sockaddr from;
- ber_int_sb_read(sb, &from, sizeof(struct sockaddr));
+ ber_int_sb_read( lc->lconn_sb, &from, sizeof(struct sockaddr) );
if (ld->ld_options.ldo_version == LDAP_VERSION2) isv2=1;
}
nextresp3:
#endif
- tag = ber_get_next( sb, &len, ber );
+ tag = ber_get_next( lc->lconn_sb, &len, ber );
if ( tag == LDAP_TAG_MESSAGE ) {
/*
* We read a complete message.
(void *)ld, (long) id, 0);
retry_ber:
ber_free( ber, 1 );
- if ( ber_sockbuf_ctrl( sb, LBER_SB_OPT_DATA_READY, NULL ) ) {
+ if ( ber_sockbuf_ctrl( lc->lconn_sb, LBER_SB_OPT_DATA_READY, NULL ) ) {
goto retry;
}
return( LDAP_MSG_X_KEEP_LOOKING ); /* continue looking */
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
#endif
- *lcp = NULL;
+ lc = *lcp = NULL;
}
}
}
* datagram, if the sockbuf is readable we still have data
* to parse.
*/
- ber = ldap_alloc_ber_with_options(ld);
- if (ber_sockbuf_ctrl(sb, LBER_SB_OPT_DATA_READY, NULL)) ok=1;
+ ber = ldap_alloc_ber_with_options( ld );
+ if ( ber_sockbuf_ctrl( lc->lconn_sb, LBER_SB_OPT_DATA_READY, NULL ) ) ok = 1;
}
/* set up response chain */
if ( tmp == NULL ) {
ld->ld_errno = LDAP_SUCCESS;
return( tag );
}
- if ( ber_sockbuf_ctrl( sb, LBER_SB_OPT_DATA_READY, NULL ) ) {
+ if ( lc && ber_sockbuf_ctrl( lc->lconn_sb, LBER_SB_OPT_DATA_READY, NULL ) ) {
goto retry;
}
return( LDAP_MSG_X_KEEP_LOOKING ); /* continue looking */