]> git.sur5r.net Git - openldap/commitdiff
Partial fix of ITS#2335, restore proper CLDAP msg format for LDAPv2
authorHoward Chu <hyc@openldap.org>
Fri, 28 Feb 2003 08:34:31 +0000 (08:34 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 28 Feb 2003 08:34:31 +0000 (08:34 +0000)
servers/slapd/connection.c
servers/slapd/result.c
servers/slapd/slap.h

index 2e79468558d7021a78931f486d0ad12532ba4983..64ad6a846d60f57c0d77723d5f73d05ce11db742 100644 (file)
@@ -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, 
@@ -1464,7 +1463,7 @@ connection_input(
                }
 
                if (conn->c_protocol == LDAP_VERSION2) {
-                       rc = ber_printf(op->o_res_ber, "{i{" /*}}*/, op->o_msgid);
+                       rc = ber_printf(op->o_res_ber, "{is{" /*}}*/, op->o_msgid, "");
                        if (rc == -1) {
 #ifdef NEW_LOGGING
                                LDAP_LOG( CONNECTION, INFO, 
index bfda458460b6ea98e7be681b8e6ba56dbe5b2253..4f438114548ce75a01c5f4e2bf0544c807bb807c 100644 (file)
@@ -277,7 +277,7 @@ send_ldap_response(
        }
 
 #ifdef LDAP_CONNECTIONLESS
-       if (conn->c_is_udp && conn->c_protocol == LDAP_VERSION2) {
+       if (conn->c_is_udp && op->o_protocol == LDAP_VERSION2) {
                rc = ber_printf( ber, "t{ess" /*"}}"*/,
                        tag, err,
                matched == NULL ? "" : matched,
@@ -774,8 +774,8 @@ slap_send_search_entry(
        ber_init_w_nullc( ber, LBER_USE_DER );
 
 #ifdef LDAP_CONNECTIONLESS
-       if (conn->c_is_udp && conn->c_protocol == LDAP_VERSION2) {
-           rc = ber_printf(ber, "t{0{" /*}}*/,
+       if (conn->c_is_udp && op->o_protocol == LDAP_VERSION2) {
+           rc = ber_printf(ber, "t{O{" /*}}*/,
                LDAP_RES_SEARCH_ENTRY, &e->e_name);
        } else
 #endif
index 340e46538f3226dce717612293c9ebccf2dc4262..d9871e0ed107c5df4e0fd52183897b6416ff17fc 100644 (file)
@@ -1807,9 +1807,6 @@ typedef struct slap_op {
        LDAP_LIST_ENTRY(slap_op) link;
 #endif
 
-#ifdef LDAP_CONNECTIONLESS
-       Sockaddr        o_peeraddr;     /* UDP peer address               */
-#endif
        AuthorizationInformation o_authz;
 
        BerElement      *o_ber;         /* ber of the request             */