]> git.sur5r.net Git - openldap/blob - servers/slapd/back-asyncmeta/unbind.c
Happy New Year
[openldap] / servers / slapd / back-asyncmeta / unbind.c
1 /* unbind.c - unbind handler for back-asyncmeta */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2016-2018 The OpenLDAP Foundation.
6  * Portions Copyright 2016 Symas Corporation.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted only as authorized by the OpenLDAP
11  * Public License.
12  *
13  * A copy of this license is available in the file LICENSE in the
14  * top-level directory of the distribution or, alternatively, at
15  * <http://www.OpenLDAP.org/license.html>.
16  */
17
18 /* ACKNOWLEDGEMENTS:
19  * This work was developed by Symas Corporation
20  * based on back-meta module for inclusion in OpenLDAP Software.
21  * This work was sponsored by Ericsson. */
22
23 #include "portable.h"
24
25 #include <stdio.h>
26
27 #include <ac/errno.h>
28 #include <ac/socket.h>
29 #include <ac/string.h>
30
31 #include "slap.h"
32 #include "../back-ldap/back-ldap.h"
33 #include "back-asyncmeta.h"
34
35 int
36 asyncmeta_back_conn_destroy(
37         Backend         *be,
38         Connection      *conn )
39 {
40         a_metainfo_t    *mi = ( a_metainfo_t * )be->be_private;
41         int             i;
42
43         Debug( LDAP_DEBUG_TRACE,
44                 "=>asyncmeta_back_conn_destroy: fetching conn=%ld DN=\"%s\"\n",
45                 conn->c_connid,
46                 BER_BVISNULL( &conn->c_ndn ) ? "" : conn->c_ndn.bv_val, 0 );
47         /*
48          * Cleanup rewrite session
49          */
50         for ( i = 0; i < mi->mi_ntargets; ++i ) {
51                 rewrite_session_delete( mi->mi_targets[ i ]->mt_rwmap.rwm_rw, conn );
52         }
53
54         return 0;
55 }