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