Lines Matching refs:lr

54 static void check_for_refs( LDAP *ld, LDAPRequest *lr, BerElement *ber,
56 static int build_result_ber( LDAP *ld, BerElement **berp, LDAPRequest *lr );
57 static void merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr );
166 LDAPRequest *lr;
223 || (( lr = nsldapi_find_request_by_msgid( ld, lm->lm_msgid ))
224 != NULL && lr->lr_outrefcnt > 0 )) {
282 LDAPRequest *lr;
316 if (( lr = nsldapi_find_request_by_msgid( ld, msgid ))
324 if ( lr->lr_conn != NULL &&
325 lr->lr_conn->lconn_status == LDAP_CONNST_DEAD ) {
326 nsldapi_free_request( ld, lr, 1 );
416 if ( lr
420 rc = nsldapi_ber_flush( ld, lc->lconn_sb, lr->lr_ber, 0, 1 );
425 lr->lr_ber->ber_end = lr->lr_ber->ber_ptr;
426 lr->lr_ber->ber_ptr = lr->lr_ber->ber_buf;
431 nsldapi_free_request( ld, lr, 0 );
502 LDAPRequest *lr;
560 lr = NULL;
561 } else if (( lr = nsldapi_find_request_by_msgid( ld, id )) == NULL ) {
577 ( lr == NULL ) ? id : lr->lr_origid );
579 if ( lr != NULL ) {
580 id = lr->lr_origid;
581 lr->lr_res_msgtype = tag;
589 check_for_refs( ld, lr, ber, lc->lconn_version, &reftotal,
592 if ( refchasing > 0 || lr->lr_outrefcnt > 0 ) {
598 lr->lr_status = LDAP_REQST_CHASINGREFS;
605 has_parent = ( lr->lr_parent != NULL );
607 if ( lr->lr_outrefcnt <= 0 && !has_parent ) {
618 LDAP_RES_BIND == lr->lr_res_msgtype &&
619 lr->lr_conn != NULL ) {
620 if ( lr->lr_conn->lconn_binddn != NULL ) {
622 lr->lr_conn->lconn_binddn );
625 lr->lr_res_msgtype, ber, &lderr, NULL,
628 lr->lr_conn->lconn_bound = 1;
629 lr->lr_conn->lconn_binddn =
630 lr->lr_binddn;
631 lr->lr_binddn = NULL;
633 lr->lr_conn->lconn_bound = 0;
634 lr->lr_conn->lconn_binddn = NULL;
647 while ( lr->lr_parent != NULL ) {
648 merge_error_info( ld, lr->lr_parent, lr );
650 lr = lr->lr_parent;
651 if ( --lr->lr_outrefcnt > 0 ) {
663 if ( lr->lr_outrefcnt <= 0 && lr->lr_parent == NULL &&
664 lr->lr_res_msgtype != LDAP_RES_SEARCH_ENTRY &&
665 lr->lr_res_msgtype != LDAP_RES_SEARCH_REFERENCE ) {
666 id = lr->lr_msgid;
667 tag = lr->lr_res_msgtype;
672 lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "",
673 lr->lr_res_matched ? lr->lr_res_matched : "" );
679 if ( build_result_ber( ld, &ber, lr )
687 nsldapi_free_request( ld, lr, 1 );
894 * errors are merged in "lr".
897 check_for_refs( LDAP *ld, LDAPRequest *lr, BerElement *ber,
907 if ( ldapversion < LDAP_VERSION2 || ( lr->lr_parent == NULL
913 if ( lr->lr_res_msgtype == LDAP_RES_SEARCH_REFERENCE ) {
918 err = nsldapi_parse_result( ld, lr->lr_res_msgtype, ber,
929 err = nsldapi_chase_v3_refs( ld, lr, v3refs,
930 ( lr->lr_res_msgtype == LDAP_RES_SEARCH_REFERENCE ),
937 err = nsldapi_chase_v2_referrals( ld, lr, &errstr,
942 if ( lr->lr_res_error != NULL ) {
943 NSLDAPI_FREE( lr->lr_res_error );
945 lr->lr_res_error = errstr;
947 if ( lr->lr_res_matched != NULL ) {
948 NSLDAPI_FREE( lr->lr_res_matched );
950 lr->lr_res_matched = matcheddn;
956 lr->lr_res_errno = LDAP_SUCCESS;
959 lr->lr_res_errno = origerr;
963 lr->lr_res_errno = err;
966 lr->lr_res_errno = ( ldapversion == LDAP_VERSION2 )
972 lr->lr_msgid, lr->lr_res_errno, 0 );
974 lr->lr_res_error ? lr->lr_res_error : "",
975 lr->lr_res_matched ? lr->lr_res_matched : "", 0 );
984 build_result_ber( LDAP *ld, BerElement **berp, LDAPRequest *lr )
996 if ( ber_printf( ber, "{it{ess}}", lr->lr_msgid,
997 (long)lr->lr_res_msgtype, lr->lr_res_errno,
998 lr->lr_res_matched ? lr->lr_res_matched : "",
999 lr->lr_res_error ? lr->lr_res_error : "" ) == -1 ) {
1015 merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr )
1018 * Merge error information in "lr" with "parentr" error code and string.
1020 if ( lr->lr_res_errno == LDAP_PARTIAL_RESULTS ) {
1021 parentr->lr_res_errno = lr->lr_res_errno;
1022 if ( lr->lr_res_error != NULL ) {
1024 lr->lr_res_error );
1026 } else if ( lr->lr_res_errno != LDAP_SUCCESS &&
1028 parentr->lr_res_errno = lr->lr_res_errno;
1032 parentr->lr_res_error = lr->lr_res_error;
1033 lr->lr_res_error = NULL;
1034 if ( NAME_ERROR( lr->lr_res_errno )) {
1038 parentr->lr_res_matched = lr->lr_res_matched;
1039 lr->lr_res_matched = NULL;