From d678a837202017dd4f5c3267cf4dd5bc7062eae5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 3 Feb 2011 21:24:26 +0000 Subject: [PATCH] Add response message for overlays --- servers/slapd/back-sock/config.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-sock/config.c b/servers/slapd/back-sock/config.c index d07d0cef11..b95a9abae6 100644 --- a/servers/slapd/back-sock/config.c +++ b/servers/slapd/back-sock/config.c @@ -31,6 +31,7 @@ static ConfigDriver bs_cf_gen; static int sock_over_setup(); +static slap_response sock_over_response; enum { BS_EXT = 1 @@ -185,11 +186,31 @@ static int sock_over_op( } static int -sock_over_response( Operatiion *op, SlapReply *rs ) +sock_over_response( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; struct sockinfo *si = (struct sockinfo *)on->on_bi.bi_private; + FILE *fp; + if ( rs->sr_type != REP_RESULT ) + return SLAP_CB_CONTINUE; + + if (( fp = opensock( si->si_sockpath )) == NULL ) + return SLAP_CB_CONTINUE; + + /* write out the result */ + fprintf( fp, "RESULT\n" ); + fprintf( fp, "msgid: %ld\n", (long) op->o_msgid ); + sock_print_conn( fp, op->o_conn, si ); + fprintf( fp, "code: %d\n", rs->sr_err ); + if ( rs->sr_matched ) + fprintf( fp, "matched: %s\n", rs->sr_matched ); + if (rs->sr_text ) + fprintf( fp, "info: %s\n", rs->sr_text ); + fprintf( fp, "\n" ); + fclose( fp ); + + return SLAP_CB_CONTINUE; } static int -- 2.39.5