Lines Matching refs:upstream

97         LloadConnection *upstream,
102 ber_printf( upstream->c_pendingber, "t{titOtO}", LDAP_TAG_MESSAGE,
114 LloadConnection *upstream,
119 CONNECTION_LOCK(upstream);
120 ber_printf( upstream->c_pendingber, "t{tit{tst{{tOOtOtO}}}}", LDAP_TAG_MESSAGE,
125 LDAP_TAG_EXOP_VERIFY_CREDENTIALS_COOKIE, BER_BV_OPTIONAL( &upstream->c_vc_cookie ),
128 CONNECTION_UNLOCK(upstream);
137 * 2) there is one bind operation pending (waiting on an upstream response)
147 * upstreams, case 2a has client_reset send an anonymous bind to upstream to
151 * If c_pin_id is unset, we request an upstream connection assigned, otherwise,
152 * we try to reuse the pinned upstream. In the case of no upstream, we reject
162 * - Otherwise, we have to ask the upstream what it thinks as the bind
184 * vessel maintaining the pin between client and upstream
197 LloadConnection *upstream = NULL;
323 /* terminate the upstream side if client switched mechanisms */
346 upstream = op->o_upstream;
349 if ( upstream ) {
350 checked_lock( &upstream->c_io_mutex );
351 CONNECTION_LOCK(upstream);
352 if ( !IS_ALIVE( upstream, c_live ) ) {
353 CONNECTION_UNLOCK(upstream);
354 checked_unlock( &upstream->c_io_mutex );
355 upstream = NULL;
360 /* If we were pinned but lost the link, don't look for a new upstream, we
362 if ( upstream ) {
365 upstream = backend_select( op, &res );
368 "connid=%lu, msgid=%d pinned upstream lost\n",
376 if ( !upstream ) {
384 assert_locked( &upstream->c_io_mutex );
387 * - upstream is READY and pin == 0
388 * - upstream is BINDING, pin != 0 and op->o_upstream_msgid == 0
390 * A pinned upstream we marked for closing at some point ago should have
394 ber = upstream->c_pendingber;
396 checked_unlock( &upstream->c_io_mutex );
398 LloadBackend *b = upstream->c_backend;
400 upstream->c_n_ops_executing--;
401 CONNECTION_UNLOCK(upstream);
408 CONNECTION_UNLOCK(upstream);
419 upstream->c_pendingber = ber;
426 ldap_tavl_delete( &upstream->c_ops, op, operation_upstream_cmp );
434 "client connid=%lu allocated pin=%lu linking it to upstream "
436 op->o_client_connid, pin, upstream->c_connid );
440 op->o_upstream = upstream;
441 op->o_upstream_connid = upstream->c_connid;
442 op->o_upstream_msgid = upstream->c_next_msgid++;
448 LloadBackend *b = upstream->c_backend;
450 upstream->c_n_ops_executing--;
451 checked_unlock( &upstream->c_io_mutex );
452 CONNECTION_UNLOCK(upstream);
469 if ( !BER_BVISNULL( &upstream->c_sasl_bind_mech ) ) {
470 ber_memfree( upstream->c_sasl_bind_mech.bv_val );
471 BER_BVZERO( &upstream->c_sasl_bind_mech );
473 } else if ( ber_bvcmp( &upstream->c_sasl_bind_mech, &mech ) ) {
474 ber_bvreplace( &upstream->c_sasl_bind_mech, &mech );
478 "added bind from client connid=%lu to upstream connid=%lu "
481 if ( ldap_tavl_insert( &upstream->c_ops, op, operation_upstream_cmp,
485 upstream->c_state = LLOAD_C_BINDING;
486 CONNECTION_UNLOCK(upstream);
490 rc = client_bind_as_vc( op, upstream, &binddn, tag, &auth );
494 rc = client_bind( op, upstream, &binddn, tag, &auth );
496 checked_unlock( &upstream->c_io_mutex );
505 if ( upstream ) {
506 connection_write_cb( -1, 0, upstream );
530 LloadConnection *upstream,
539 CONNECTION_ASSERT_LOCKED(upstream);
540 removed = ldap_tavl_delete( &upstream->c_ops, op, operation_upstream_cmp );
542 assert( upstream->c_state != LLOAD_C_BINDING );
546 assert( removed == op && upstream->c_state == LLOAD_C_BINDING );
548 CONNECTION_UNLOCK(upstream);
550 checked_lock( &upstream->c_io_mutex );
551 output = upstream->c_pendingber;
553 checked_unlock( &upstream->c_io_mutex );
554 CONNECTION_LOCK_DESTROY(upstream);
557 upstream->c_pendingber = output;
559 msgid = upstream->c_next_msgid++;
566 CONNECTION_LOCK(upstream);
567 checked_unlock( &upstream->c_io_mutex );
577 &upstream->c_ops, op, operation_upstream_cmp, ldap_avl_dup_error );
580 CONNECTION_UNLOCK(upstream);
583 "SASL exchange in lieu of client connid=%lu to upstream "
587 connection_write_cb( -1, 0, upstream );
597 LloadConnection *upstream;
629 upstream = op->o_upstream;
631 if ( !upstream ) {
635 CONNECTION_LOCK(upstream);
636 if ( !ldap_tavl_find( upstream->c_ops, op, operation_upstream_cmp ) ) {
645 CONNECTION_UNLOCK(upstream);
654 if ( upstream->c_state == LLOAD_C_CLOSING ) {
658 !BER_BVISNULL( &upstream->c_sasl_bind_mech ) ) {
659 CONNECTION_UNLOCK(upstream);
661 op, LDAP_OTHER, "upstream connection is closing", 0 );
671 ldap_tavl_delete( &upstream->c_ops, op, operation_upstream_cmp );
674 &upstream->c_ops, op, operation_upstream_cmp, ldap_avl_dup_error );
678 if ( !BER_BVISNULL( &upstream->c_sasl_bind_mech ) ) {
680 ber_memfree( upstream->c_sasl_bind_mech.bv_val );
681 BER_BVZERO( &upstream->c_sasl_bind_mech );
689 return finish_sasl_bind( upstream, op, ber );
693 CONNECTION_UNLOCK(upstream);
696 operation_unlink_upstream( op, upstream );
760 LloadConnection *upstream;
775 operation_send_reject( op, LDAP_OTHER, "upstream protocol error", 0 );
780 upstream = op->o_upstream;
782 if ( !upstream ) {
787 /* Clear upstream status */
788 operation_unlink_upstream( op, upstream );
793 CONNECTION_LOCK(upstream);
794 b = upstream->c_backend;
800 CONNECTION_UNLOCK(upstream);
801 operation_send_reject( op, LDAP_OTHER, "upstream protocol error", 0 );
882 LloadConnection *upstream;
885 upstream = op->o_upstream;
887 if ( upstream ) {
890 CONNECTION_LOCK(upstream);
891 b = upstream->c_backend;
895 CONNECTION_UNLOCK(upstream);