]> git.sur5r.net Git - openldap/blob - servers/ldapd/abandon.c
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / servers / ldapd / abandon.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright (c) 1990 Regents of the University of Michigan.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms are permitted
7  * provided that this notice is preserved and that due credit is given
8  * to the University of Michigan at Ann Arbor. The name of the University
9  * may not be used to endorse or promote products derived from this
10  * software without specific prior written permission. This software
11  * is provided ``as is'' without express or implied warranty.
12  */
13
14 #include "portable.h"
15
16 #include <stdio.h>
17
18 #include <ac/socket.h>
19
20 #include <quipu/commonarg.h>
21 #include <quipu/attrvalue.h>
22 #include <quipu/ds_error.h>
23 #include <quipu/abandon.h>
24 #include <quipu/dap2.h>
25 #include <quipu/dua.h>
26
27 #include "lber.h"
28 #include "ldap.h"
29 #include "common.h"
30
31 int
32 do_abandon(
33     struct conn *dsaconn,
34     BerElement  *ber,
35     int         msgid
36 )
37 {
38         int                     id;
39         struct ds_abandon_arg   aa;
40         struct DAPindication    di;
41
42         Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0 ,0 );
43
44         /*
45          * Parse the abandon request.  It looks like this:
46          *      AbandonRequest := MessageID
47          */
48
49         if ( ber_scanf( ber, "i", &id ) == LBER_ERROR ) {
50                 Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0 ,0 );
51                 return( 0 );
52         }
53
54         Debug( LDAP_DEBUG_ARGS, "do_abandin: id %d\n", id, 0 ,0 );
55
56         aa.aba_invokeid = id;
57
58         Debug( LDAP_DEBUG_TRACE, "DapAbandon...\n", 0, 0 ,0 );
59         if ( DapAbandon( dsaconn->c_ad, msgid, &aa, &di, ROS_ASYNC )
60             == NOTOK ) {
61                 Debug( LDAP_DEBUG_ANY, "DapAbandon failed\n", 0, 0 ,0 );
62                 return( 0 );
63         }
64         Debug( LDAP_DEBUG_TRACE, "DapAbandon completed\n", 0, 0 ,0 );
65
66         return( 0 );
67 }