]> git.sur5r.net Git - openldap/commitdiff
Add response message for overlays
authorHoward Chu <hyc@openldap.org>
Thu, 3 Feb 2011 21:24:26 +0000 (21:24 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 4 Nov 2011 20:21:45 +0000 (13:21 -0700)
servers/slapd/back-sock/config.c

index d07d0cef11845103af1864e71ba2c93ca2cc51c0..b95a9abae6f33bb46a487452fd4afe90f30624b4 100644 (file)
@@ -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