+static int txn_put_ctrls( Operation *op, BerElement *ber, txn_rctrls *tr )
+{
+ txn_rctrls *next;
+ int i;
+ ber_printf( ber, "{" );
+ for ( ; tr; tr = next ) {
+ next = tr->tr_next;
+ ber_printf( ber, "{it{", tr->tr_msgid, LDAP_TAG_CONTROLS );
+ for ( i = 0; tr->tr_ctrls[i]; i++ )
+ ldap_pvt_put_control( tr->tr_ctrls[i], ber );
+ ber_printf( ber, "}}" );
+ ldap_controls_free( tr->tr_ctrls );
+ op->o_tmpfree( tr, op->o_tmpmemctx );
+ }
+ ber_printf( ber, "}" );
+ return 0;
+}
+