From 573df041398651fbd04a01e86abb0272461809be Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 1 Jul 2005 11:31:20 +0000 Subject: [PATCH] honor size limit in ldap queries --- tinyldap.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tinyldap.c b/tinyldap.c index 7002afb..2f558d8 100644 --- a/tinyldap.c +++ b/tinyldap.c @@ -752,6 +752,7 @@ found: } #endif if ((tmp=scan_ldapsearchrequest(buf+res,buf+res+len,&sr))) { + unsigned long returned=0; #if (debug != 0) if (debug) { @@ -797,8 +798,11 @@ found: if (isset(result,i)) { uint32 j; uint32_unpack(map+indices_offset+4*i,&j); - if (ldap_match_mapped(j,&sr)) + if (ldap_match_mapped(j,&sr)) { + if (sr.sizeLimit && sr.sizeLimit>++returned) + break; answerwith(j,&sr,messageid,out); + } } } } @@ -811,8 +815,11 @@ found: for (i=0; i++returned) + break; answerwith(x-map,&sr,messageid,out); + } x+=j*8; } }