]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-perl/search.c
Merge remote branch 'origin/mdb.master'
[openldap] / servers / slapd / back-perl / search.c
index 21b9a12fd94ec39f7cd756f8aa854218fed2ec6f..c7428010f816d4c1d8da5ac6b8469d0d958c041d 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2004 The OpenLDAP Foundation.
+ * Copyright 1999-2012 The OpenLDAP Foundation.
  * Portions Copyright 1999 John C. Quillan.
  * Portions Copyright 2002 myinternet Limited.
  * All rights reserved.
  * <http://www.OpenLDAP.org/license.html>.
  */
 
-#include <EXTERN.h>
-#include <perl.h>
-#undef _ /* #defined by both Perl and ac/localize.h */
-
-#ifdef HAVE_WIN32_ASPERL
-#include "asperl_undefs.h"
-#endif
-
-#include "portable.h"
-
-#include <stdio.h>
-
-#include "slap.h"
-
 #include "perl_back.h"
 
 /**********************************************************
@@ -48,6 +34,7 @@ perl_back_search(
        char *buf;
        int i;
 
+       PERL_SET_CONTEXT( PERL_INTERPRETER );
        ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );  
 
        {
@@ -68,11 +55,7 @@ perl_back_search(
                }
                PUTBACK;
 
-#ifdef PERL_IS_5_6
                count = call_method("search", G_ARRAY );
-#else
-               count = perl_call_method("search", G_ARRAY );
-#endif
 
                SPAGAIN;
 
@@ -100,7 +83,15 @@ perl_back_search(
                                        if (send_entry) {
                                                rs->sr_entry = e;
                                                rs->sr_attrs = op->ors_attrs;
-                                               send_search_entry( op, rs );
+                                               rs->sr_flags = REP_ENTRY_MODIFIABLE;
+                                               rs->sr_err = LDAP_SUCCESS;
+                                               rs->sr_err = send_search_entry( op, rs );
+                                               rs->sr_flags = 0;
+                                               rs->sr_attrs = NULL;
+                                               rs->sr_entry = NULL;
+                                               if ( rs->sr_err == LDAP_SIZELIMIT_EXCEEDED ) {
+                                                       goto done;
+                                               }
                                        }
 
                                        entry_free( e );
@@ -119,8 +110,7 @@ perl_back_search(
 
                rs->sr_err = POPi;
 
-
-
+done:;
                PUTBACK; FREETMPS; LEAVE;
        }
 
@@ -130,4 +120,3 @@ perl_back_search(
 
        return 0;
 }
-