X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-perl%2Fsearch.c;h=c7428010f816d4c1d8da5ac6b8469d0d958c041d;hb=9547dd7a0d9fd079e6e75fb59b20a2fc661c9782;hp=21b9a12fd94ec39f7cd756f8aa854218fed2ec6f;hpb=3c598e89fb34a892d369a138daa8c3314294493c;p=openldap
diff --git a/servers/slapd/back-perl/search.c b/servers/slapd/back-perl/search.c
index 21b9a12fd9..c7428010f8 100644
--- a/servers/slapd/back-perl/search.c
+++ b/servers/slapd/back-perl/search.c
@@ -1,7 +1,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software .
*
- * 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.
@@ -15,20 +15,6 @@
* .
*/
-#include
-#include
-#undef _ /* #defined by both Perl and ac/localize.h */
-
-#ifdef HAVE_WIN32_ASPERL
-#include "asperl_undefs.h"
-#endif
-
-#include "portable.h"
-
-#include
-
-#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;
}
-