]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/controls.c
Add referral generator
[openldap] / servers / slapd / controls.c
index c5cdb803d40a2400266afab80706450cac61f612..e99eeed1e5909301c8c437bcf9ceadcc7be78ef2 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /* 
- * Copyright 1999 The OpenLDAP Foundation.
+ * Copyright 1999-2000 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms are permitted only
@@ -21,7 +21,6 @@
 
 char *supportedControls[] = {
        LDAP_CONTROL_MANAGEDSAIT,
-/*     LDAP_CONTROL_X_CHANGE_PASSWD, */
        NULL
 };
 
@@ -49,7 +48,7 @@ int get_ctrls(
 
        if(( tag = ber_peek_tag( ber, &len )) != LDAP_TAG_CONTROLS ) {
                if( tag == LBER_ERROR ) {
-                       rc = -1;
+                       rc = SLAPD_DISCONNECT;
                        errmsg = "unexpected data in PDU";
                }
 
@@ -59,7 +58,7 @@ int get_ctrls(
        Debug( LDAP_DEBUG_TRACE, "=> get_ctrls\n", 0, 0, 0 );
 
        if( op->o_protocol < LDAP_VERSION3 ) {
-               rc = -1;
+               rc = SLAPD_DISCONNECT;
                errmsg = "controls require LDAPv3";
                goto return_results;
        }
@@ -121,7 +120,7 @@ int get_ctrls(
                                0, 0, 0 );
                        *ctrls = NULL;
                        ldap_controls_free( tctrls );
-                       rc = -1;
+                       rc = SLAPD_DISCONNECT;
                        errmsg = "decoding controls error";
                        goto return_results;
                }
@@ -137,7 +136,7 @@ int get_ctrls(
                                        0, 0, 0 );
                                *ctrls = NULL;
                                ldap_controls_free( tctrls );
-                               rc = -1;
+                               rc = SLAPD_DISCONNECT;
                                errmsg = "decoding controls error";
                                goto return_results;
                        }
@@ -159,7 +158,7 @@ int get_ctrls(
                                        0, 0, 0 );
                                *ctrls = NULL;
                                ldap_controls_free( tctrls );
-                               rc = -1;
+                               rc = SLAPD_DISCONNECT;
                                errmsg = "decoding controls error";
                                goto return_results;
                        }
@@ -181,7 +180,7 @@ return_results:
                nctrls, rc, errmsg ? errmsg : "");
 
        if( sendres && rc != LDAP_SUCCESS ) {
-               if( rc == -1 ) {
+               if( rc == SLAPD_DISCONNECT ) {
                        send_ldap_disconnect( conn, op, rc, errmsg );
                } else {
                        send_ldap_result( conn, op, rc,