]> git.sur5r.net Git - openldap/blob - libraries/libldap/cancel.c
ITS#2484, set sasl_maxbuf to SASL_MAX_BUFF_SIZE if it was negotiated
[openldap] / libraries / libldap / cancel.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 /*
8  * LDAPv3 Cancel Operation Request
9  */
10
11 #include "portable.h"
12
13 #include <stdio.h>
14 #include <ac/stdlib.h>
15
16 #include <ac/socket.h>
17 #include <ac/string.h>
18 #include <ac/time.h>
19
20 #include "ldap-int.h"
21 #include "ldap_log.h"
22
23 #ifdef LDAP_EXOP_X_CANCEL
24
25 int
26 ldap_cancel(
27         LDAP            *ld,
28         int             cancelid,
29         LDAPControl     **sctrls,
30         LDAPControl     **cctrls,
31         int             *msgidp )
32 {
33         BerElement *cancelidber = NULL;
34         struct berval *cancelidvalp = NULL;
35         int rc;
36
37         cancelidber = ber_alloc_t( LBER_USE_DER );
38         ber_printf( cancelidber, "{i}", cancelid );
39         ber_flatten( cancelidber, &cancelidvalp );
40         rc = ldap_extended_operation( ld, LDAP_EXOP_X_CANCEL,
41                         cancelidvalp, sctrls, cctrls, msgidp );
42         ber_free( cancelidber, 1 );
43         return rc;
44 }
45
46 int
47 ldap_cancel_s(
48         LDAP            *ld,
49         int             cancelid,
50         LDAPControl     **sctrls,
51         LDAPControl     **cctrls )
52 {
53         BerElement *cancelidber = NULL;
54         struct berval *cancelidvalp = NULL;
55         int rc;
56
57         cancelidber = ber_alloc_t( LBER_USE_DER );
58         ber_printf( cancelidber, "{i}", cancelid );
59         ber_flatten( cancelidber, &cancelidvalp );
60         rc = ldap_extended_operation_s( ld, LDAP_EXOP_X_CANCEL,
61                         cancelidvalp, sctrls, cctrls, NULL, NULL );
62         ber_free( cancelidber, 1 );
63         return rc;
64 }
65
66 #endif /* LDAP_EXOP_X_CANCEL */