ITS#3671 add REP_ENTRY_MUSTRELEASE flag, release the entry before

attempting to write the response on the network. (This should probably
be the default behavior anyway, since network hangs of this sort can
cause problems for any backend that has entry locks.)
This commit is contained in:
Howard Chu 2005-04-24 22:21:57 +00:00
parent a6fb962984
commit b92387bb1c
2 changed files with 14 additions and 1 deletions

View File

@ -1192,6 +1192,12 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
goto error_return;
}
if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
be_entry_release_rw( op, rs->sr_entry, 0 );
rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
rs->sr_entry = NULL;
}
if ( op->o_res_ber == NULL ) {
bytes = send_ldap_ber( op->o_conn, ber );
ber_free_buf( ber );
@ -1214,7 +1220,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
}
Statslog( LDAP_DEBUG_STATS2, "%s ENTRY dn=\"%s\"\n",
op->o_log_prefix, rs->sr_entry->e_dn, 0, 0, 0 );
op->o_log_prefix, edn, 0, 0, 0 );
Debug( LDAP_DEBUG_TRACE,
"<= send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 );
@ -1387,6 +1393,12 @@ slap_send_search_reference( Operation *op, SlapReply *rs )
goto rel;
}
if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
be_entry_release_rw( op, rs->sr_entry, 0 );
rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
rs->sr_entry = NULL;
}
#ifdef LDAP_CONNECTIONLESS
if (!op->o_conn || op->o_conn->c_is_udp == 0) {
#endif

View File

@ -1913,6 +1913,7 @@ typedef struct slap_rep {
slap_mask_t sr_flags;
#define REP_ENTRY_MODIFIABLE 0x0001U
#define REP_ENTRY_MUSTBEFREED 0x0002U
#define REP_ENTRY_MUSTRELEASE 0x0004U
#define REP_MATCHED_MUSTBEFREED 0x0010U
#define REP_REF_MUSTBEFREED 0x0020U
} SlapReply;