]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/unbind.c
Import ITS#3278 from HEAD
[openldap] / libraries / libldap / unbind.c
index 2ac13904a69602b3415dacbf93e56ae0095b1a28..9de2a1d801b1ca63e0c65a2cc771dba879a3fc9a 100644 (file)
@@ -1,13 +1,22 @@
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- */
-/*  Portions
- *  Copyright (c) 1990 Regents of the University of Michigan.
- *  All rights reserved.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2005 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
  *
- *  unbind.c
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* Portions Copyright (c) 1990 Regents of the University of Michigan.
+ * All rights reserved.
+ */
+/* Portions Copyright (C) The Internet Society (1997)
+ * ASN.1 fragments are from RFC 2251; see RFC for full legal notices.
  */
 
 /* An Unbind Request looks like this:
@@ -193,6 +202,7 @@ ldap_send_unbind(
        LDAPControl **cctrls )
 {
        BerElement      *ber;
+       ber_int_t       id;
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ENTRY, "ldap_send_unbind\n", 0, 0, 0 );
@@ -209,8 +219,9 @@ ldap_send_unbind(
                return( ld->ld_errno );
        }
 
+       LDAP_NEXT_MSGID( ld, id );
        /* fill it in */
-       if ( ber_printf( ber, "{itn" /*}*/, ++ld->ld_msgid,
+       if ( ber_printf( ber, "{itn" /*}*/, id,
            LDAP_REQ_UNBIND ) == -1 ) {
                ld->ld_errno = LDAP_ENCODING_ERROR;
                ber_free( ber, 1 );