]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/connection.c
cleanup bind
[openldap] / servers / slapd / connection.c
index f5fe518b7745e7cf9771778924e01ddefa969887..20da8a2e5cbbf9d14e759e065178bc0d76e75797 100644 (file)
@@ -1028,12 +1028,12 @@ operations_error:
        ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
 
 #ifdef LDAP_EXOP_X_CANCEL
-       if ( arg->co_op->o_cancel == LDAP_CANCEL_REQ ) {
+       if ( arg->co_op->o_cancel == SLAP_CANCEL_REQ ) {
                arg->co_op->o_cancel = LDAP_TOO_LATE;
        }
 
-       while ( arg->co_op->o_cancel != LDAP_CANCEL_NONE &&
-               arg->co_op->o_cancel != LDAP_CANCEL_DONE )
+       while ( arg->co_op->o_cancel != SLAP_CANCEL_NONE &&
+               arg->co_op->o_cancel != SLAP_CANCEL_DONE )
        {
                ldap_pvt_thread_yield();
        }
@@ -1048,7 +1048,7 @@ operations_error:
        LDAP_STAILQ_NEXT(arg->co_op, o_next) = NULL;
 
 #if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
-       if ( arg->co_op->o_cancel == LDAP_CANCEL_ACK )
+       if ( arg->co_op->o_cancel == SLAP_CANCEL_ACK )
                goto co_op_free;
 #endif
 #ifdef LDAP_CLIENT_UPDATE
@@ -1439,19 +1439,18 @@ connection_input(
        op->o_pagedresults_state = conn->c_pagedresults_state;
 #endif
 #ifdef LDAP_CONNECTIONLESS
-       op->o_peeraddr = peeraddr;
-       if (cdn ) {
-           ber_str2bv( cdn, 0, 1, &op->o_dn );
-           op->o_protocol = LDAP_VERSION2;
-       }
        if (conn->c_is_udp) {
                int rc;
 
+               if ( cdn ) {
+                   ber_str2bv( cdn, 0, 1, &op->o_dn );
+                   op->o_protocol = LDAP_VERSION2;
+               }
                op->o_res_ber = ber_alloc_t( LBER_USE_DER );
                if (op->o_res_ber == NULL)
                        return 1;
 
-               rc = ber_write(op->o_res_ber, (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0);
+               rc = ber_write(op->o_res_ber, (char *)&peeraddr, sizeof(struct sockaddr), 0);
                if (rc != sizeof(struct sockaddr)) {
 #ifdef NEW_LOGGING
                        LDAP_LOG( CONNECTION, INFO, 
@@ -1463,8 +1462,8 @@ connection_input(
                        return 1;
                }
 
-               if (conn->c_protocol == LDAP_VERSION2) {
-                       rc = ber_printf(op->o_res_ber, "{i{" /*}}*/, op->o_msgid);
+               if (op->o_protocol == LDAP_VERSION2) {
+                       rc = ber_printf(op->o_res_ber, "{is{" /*}}*/, op->o_msgid, "");
                        if (rc == -1) {
 #ifdef NEW_LOGGING
                                LDAP_LOG( CONNECTION, INFO,