Skip to content
Snippets Groups Projects
Commit b92387bb authored by Howard Chu's avatar Howard Chu
Browse files

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.)
parent a6fb9629
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment