Commit 80b5798d authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix tag/msgid bugs. Branch now passes 'cd tests/make ldbm' (which

doesn't say anything about referrals).
parent 317d6587
...@@ -57,6 +57,14 @@ static ber_tag_t req2res( ber_tag_t tag ) ...@@ -57,6 +57,14 @@ static ber_tag_t req2res( ber_tag_t tag )
case LDAP_REQ_UNBIND: case LDAP_REQ_UNBIND:
tag = LBER_SEQUENCE; tag = LBER_SEQUENCE;
break; break;
case LDAP_REQ_SEARCH:
tag = LDAP_RES_SEARCH_RESULT;
break;
default:
assert( 0 );
tag = LBER_ERROR;
} }
return tag; return tag;
} }
...@@ -119,7 +127,6 @@ long send_ldap_ber( ...@@ -119,7 +127,6 @@ long send_ldap_ber(
ldap_pvt_thread_mutex_unlock( &conn->c_mutex ); ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
ldap_pvt_thread_mutex_unlock( &conn->c_write_mutex ); ldap_pvt_thread_mutex_unlock( &conn->c_write_mutex );
Debug( LDAP_DEBUG_TRACE, "<= send_ldap_ber\n", 0, 0, 0 );
return bytes; return bytes;
} }
...@@ -143,6 +150,9 @@ send_ldap_response( ...@@ -143,6 +150,9 @@ send_ldap_response(
ber = ber_alloc_t( LBER_USE_DER ); ber = ber_alloc_t( LBER_USE_DER );
Debug( LDAP_DEBUG_TRACE, "send_ldap_response: tag=%ld msgid=%ld err=%ld\n",
(long) tag, (long) msgid, (long) err );
if ( ber == NULL ) { if ( ber == NULL ) {
Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 ); Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
return; return;
...@@ -286,6 +296,9 @@ send_ldap_result( ...@@ -286,6 +296,9 @@ send_ldap_result(
} }
} }
tag = req2res( op->o_tag );
msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0;
#ifdef LDAP_CONNECTIONLESS #ifdef LDAP_CONNECTIONLESS
if ( op->o_cldap ) { if ( op->o_cldap ) {
ber_pvt_sb_udp_set_dst( &conn->c_sb, &op->o_clientaddr ); ber_pvt_sb_udp_set_dst( &conn->c_sb, &op->o_clientaddr );
...@@ -349,6 +362,9 @@ send_search_result( ...@@ -349,6 +362,9 @@ send_search_result(
} }
} }
tag = req2res( op->o_tag );
msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0;
#ifdef LDAP_CONNECTIONLESS #ifdef LDAP_CONNECTIONLESS
if ( op->o_cldap ) { if ( op->o_cldap ) {
ber_pvt_sb_udp_set_dst( &conn->c_sb, &op->o_clientaddr ); ber_pvt_sb_udp_set_dst( &conn->c_sb, &op->o_clientaddr );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment