mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-28 02:29:34 -05:00
Fix pinned operation forwarding
This commit is contained in:
parent
2ba833680f
commit
cbc0ec04c0
4 changed files with 23 additions and 3 deletions
|
|
@ -476,6 +476,7 @@ handle_bind_response(
|
|||
if ( client->c_state == LLOAD_C_BINDING ) {
|
||||
switch ( result ) {
|
||||
case LDAP_SASL_BIND_IN_PROGRESS:
|
||||
op->o_saved_msgid = op->o_client_msgid;
|
||||
op->o_client_msgid = 0;
|
||||
rc = tavl_insert( &client->c_ops, op, operation_client_cmp,
|
||||
avl_dup_error );
|
||||
|
|
|
|||
|
|
@ -306,6 +306,7 @@ struct LloadOperation {
|
|||
unsigned long o_client_connid;
|
||||
int o_client_live, o_client_refcnt;
|
||||
ber_int_t o_client_msgid;
|
||||
ber_int_t o_saved_msgid;
|
||||
|
||||
LloadConnection *o_upstream;
|
||||
unsigned long o_upstream_connid;
|
||||
|
|
|
|||
|
|
@ -696,6 +696,14 @@ operation_send_reject_locked(
|
|||
goto done;
|
||||
}
|
||||
|
||||
if ( op->o_client_msgid == 0 ) {
|
||||
assert( op->o_saved_msgid == 0 && op->o_pin_id );
|
||||
Debug( LDAP_DEBUG_TRACE, "operation_send_reject_locked: "
|
||||
"operation pin=%lu is just a pin, not sending\n",
|
||||
op->o_pin_id );
|
||||
goto done;
|
||||
}
|
||||
|
||||
CONNECTION_UNLOCK_INCREF(c);
|
||||
ldap_pvt_thread_mutex_lock( &c->c_io_mutex );
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,20 @@ forward_response( LloadConnection *client, LloadOperation *op, BerElement *ber )
|
|||
{
|
||||
BerElement *output;
|
||||
BerValue response, controls = BER_BVNULL;
|
||||
ber_int_t msgid;
|
||||
ber_tag_t tag, response_tag;
|
||||
ber_len_t len;
|
||||
|
||||
CONNECTION_LOCK(client);
|
||||
if ( op->o_client_msgid ) {
|
||||
msgid = op->o_client_msgid;
|
||||
} else {
|
||||
assert( op->o_pin_id );
|
||||
msgid = op->o_saved_msgid;
|
||||
op->o_saved_msgid = 0;
|
||||
}
|
||||
CONNECTION_UNLOCK(client);
|
||||
|
||||
response_tag = ber_skip_element( ber, &response );
|
||||
|
||||
tag = ber_peek_tag( ber, &len );
|
||||
|
|
@ -41,8 +52,7 @@ forward_response( LloadConnection *client, LloadOperation *op, BerElement *ber )
|
|||
|
||||
Debug( LDAP_DEBUG_TRACE, "forward_response: "
|
||||
"%s to client connid=%lu request msgid=%d\n",
|
||||
lload_msgtype2str( response_tag ), op->o_client_connid,
|
||||
op->o_client_msgid );
|
||||
lload_msgtype2str( response_tag ), op->o_client_connid, msgid );
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &client->c_io_mutex );
|
||||
output = client->c_pendingber;
|
||||
|
|
@ -54,7 +64,7 @@ forward_response( LloadConnection *client, LloadOperation *op, BerElement *ber )
|
|||
client->c_pendingber = output;
|
||||
|
||||
ber_printf( output, "t{titOtO}", LDAP_TAG_MESSAGE,
|
||||
LDAP_TAG_MSGID, op->o_client_msgid,
|
||||
LDAP_TAG_MSGID, msgid,
|
||||
response_tag, &response,
|
||||
LDAP_TAG_CONTROLS, BER_BV_OPTIONAL( &controls ) );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue