]> git.sur5r.net Git - openldap/commitdiff
Fix intermediate responses
authorKurt Zeilenga <kurt@openldap.org>
Sat, 31 May 2003 05:32:57 +0000 (05:32 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 31 May 2003 05:32:57 +0000 (05:32 +0000)
servers/slapd/result.c
servers/slapd/slap.h
servers/slapd/syncrepl.c

index 0888e3e74bf81da526beab2c2a20a99eda2f0dcd..6e8ee40ab1738b62611d30b2b6dfc6a4d0d554e3 100644 (file)
@@ -267,14 +267,20 @@ send_ldap_response(
        }
 
 #ifdef LDAP_CONNECTIONLESS
-       if (op->o_conn && op->o_conn->c_is_udp && op->o_protocol == LDAP_VERSION2) {
+       if (op->o_conn && op->o_conn->c_is_udp &&
+               op->o_protocol == LDAP_VERSION2 )
+       {
                rc = ber_printf( ber, "t{ess" /*"}}"*/,
                        rs->sr_tag, rs->sr_err,
                rs->sr_matched == NULL ? "" : rs->sr_matched,
                rs->sr_text == NULL ? "" : rs->sr_text );
        } else 
 #endif
-       {
+       if ( rs->sr_type == REP_INTERMEDIATE ) {
+           rc = ber_printf( ber, "{it{" /*"}}"*/,
+                       rs->sr_msgid, rs->sr_tag );
+
+       } else {
            rc = ber_printf( ber, "{it{ess" /*"}}"*/,
                rs->sr_msgid, rs->sr_tag, rs->sr_err,
                rs->sr_matched == NULL ? "" : rs->sr_matched,
@@ -296,7 +302,9 @@ send_ldap_response(
                        LDAP_TAG_SASL_RES_CREDS, rs->sr_sasldata );
        }
 
-       if( rc != -1 && rs->sr_type == REP_EXTENDED ) {
+       if( rc != -1 &&
+               ( rs->sr_type == REP_EXTENDED || rs->sr_type == REP_INTERMEDIATE ))
+       {
                if ( rs->sr_rspoid != NULL ) {
                        rc = ber_printf( ber, "ts",
                                LDAP_TAG_EXOP_RES_OID, rs->sr_rspoid );
@@ -551,11 +559,10 @@ slap_send_ldap_extended( Operation *op, SlapReply *rs )
        send_ldap_response( op, rs );
 }
 
-#ifdef LDAP_RES_INTERMEDIATE
 void
 slap_send_ldap_intermediate( Operation *op, SlapReply *rs )
 {
-       rs->sr_type = REP_EXTENDED;
+       rs->sr_type = REP_INTERMEDIATE;
 #ifdef NEW_LOGGING
        LDAP_LOG( OPERATION, ENTRY,
                "send_ldap_intermediate: err=%d oid=%s len=%ld\n",
@@ -572,7 +579,6 @@ slap_send_ldap_intermediate( Operation *op, SlapReply *rs )
        rs->sr_msgid = op->o_msgid;
        send_ldap_response( op, rs );
 }
-#endif
 
 int
 slap_send_search_entry( Operation *op, SlapReply *rs )
index e6704a240c9fa4310b7daff4eeeb4db2f5ae8b92..0e4ecde52ed9a06e7d43e6811dd0080736ae78bc 100644 (file)
@@ -1575,7 +1575,8 @@ typedef enum slap_reply_e {
        REP_SASL,
        REP_EXTENDED,
        REP_SEARCH,
-       REP_SEARCHREF
+       REP_SEARCHREF,
+       REP_INTERMEDIATE
 } slap_reply_t;
 
 typedef struct rep_sasl_s {
index 4c5222d465491362d3d72ddea2052d8232dbefec..6f4eb6d04a3effa5b27b18b877d4a89f03224163 100644 (file)
@@ -557,8 +557,9 @@ do_syncrepl(
                                break;
 
                        case LDAP_RES_INTERMEDIATE:
-                               ldap_parse_intermediate( ld, msg, &retoid, &retdata, NULL, 0 );
-                               if ( !strcmp( retoid, LDAP_SYNC_INFO ) ) {
+                               rc = ldap_parse_intermediate( ld, msg,
+                                       &retoid, &retdata, NULL, 0 );
+                               if ( !rc && !strcmp( retoid, LDAP_SYNC_INFO ) ) {
                                        sync_info_arrived = 1;
                                        res_ber = ber_init( retdata );
                                        ber_scanf( res_ber, "{e", &syncstate );
@@ -605,8 +606,8 @@ do_syncrepl(
                                                "response\n", 0, 0, 0 );
 #else
                                        Debug( LDAP_DEBUG_ANY, "do_syncrepl : "
-                                               "unknown intermediate "
-                                               "response\n", 0, 0, 0 );
+                                               "unknown intermediate response (%d)\n",
+                                               rc, 0, 0 );
 #endif
                                        ldap_memfree( retoid );
                                        ber_bvfree( retdata );