]> git.sur5r.net Git - openldap/commitdiff
more on ITS#5931: handle intermediate responses and support syncrepl also in back...
authorPierangelo Masarati <ando@openldap.org>
Tue, 10 Feb 2009 14:27:28 +0000 (14:27 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 10 Feb 2009 14:27:28 +0000 (14:27 +0000)
servers/slapd/back-ldap/search.c

index f797474a523532009d448c4e178431393c283b8e..861418c8e4e5f2e6948ce70cb5cf19e4c856e5e7 100644 (file)
@@ -424,10 +424,34 @@ retry:
                        }
 
                } else if ( rc == LDAP_RES_INTERMEDIATE ) {
-                       Debug( LDAP_DEBUG_ANY,
-                               "%s ldap_back_search: "
-                               "intermediate response not supported yet.\n",
-                               op->o_log_prefix, 0, 0 );
+                       /* FIXME: response controls
+                        * are passed without checks */
+                       rc = ldap_parse_intermediate( lc->lc_ld,
+                               res,
+                               &rs->sr_rspoid,
+                               &rs->sr_rspdata,
+                               &rs->sr_ctrls,
+                               0 );
+                       if ( rc != LDAP_SUCCESS ) {
+                               continue;
+                       }
+
+                       slap_send_ldap_intermediate( op, rs );
+
+                       if ( rs->sr_rspoid != NULL ) {
+                               ber_memfree( rs->sr_rspoid );
+                               rs->sr_rspoid = NULL;
+                       }
+
+                       if ( rs->sr_rspdata != NULL ) {
+                               ber_bvfree( rs->sr_rspdata );
+                               rs->sr_rspdata = NULL;
+                       }
+
+                       if ( rs->sr_ctrls != NULL ) {
+                               ldap_controls_free( rs->sr_ctrls );
+                               rs->sr_ctrls = NULL;
+                       }
 
                } else {
                        char            *err = NULL;