]> git.sur5r.net Git - openldap/blob - servers/slapd/back-asyncmeta/abandon.c
28dc15befda1313aa635c460a8063b7c7208063b
[openldap] / servers / slapd / back-asyncmeta / abandon.c
1 /* abandon.c - abandon request handler for back-asyncmeta */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2016-2017 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/string.h>
28 #include <ac/socket.h>
29
30 #include "slap.h"
31 #include "../back-ldap/back-ldap.h"
32 #include "back-asyncmeta.h"
33 #include "ldap_rq.h"
34
35 /* function is unused */
36 int
37 asyncmeta_back_abandon( Operation *op, SlapReply *rs )
38 {
39         Operation *t_op;
40
41         /* Find the ops being abandoned */
42         ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
43
44         LDAP_STAILQ_FOREACH( t_op, &op->o_conn->c_ops, o_next ) {
45                 if ( t_op->o_msgid == op->orn_msgid ) {
46                         t_op->o_abandon = 1;
47                 }
48         }
49         ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
50
51         return LDAP_SUCCESS;
52 }