From:             fernando dot wendt at gmail dot com
Operating system: GNU-Linux
PHP version:      5.2.4
PHP Bug Type:     LDAP related
Bug description:  Timeout parameter sugest for ldap_bind and/or ldap_connect

Description:
------------
I do suggest that PHP LDAP functions "ldap_bind" and/or "ldap_connect" are
improved to suport a new parameter to control network timeout over the
request.

At some cases, the HTTP request is send to webserver (like Ajax can do),
and it can't be handling for stop processing - on the server side (because
XMLHTTPRequest has an "abort" method avaliable - for the client side). So,
if there are a lot of online users trying to get the same LDAP large
entries, the webserver probably hangs up (or even crashes).

That hangs on the request processing for large data ranges from LDAP data
sources (i.e: more than 5000 entries). Plus, the network state is too
involved at this new suggested behavior, in order to be manipulated at some
way.

So, adding this parameter function, PHP could limits the request response
in order to control it, by the time.

Reproduce code:
---------------
$host = "localhost";
$basedn = "ou=MYCOMPANY";

if ($con = ldap_connect($host)){
  ldap_set_option($con, LDAP_OPT_TIMELIMIT, 10);
  echo "Connected";

  $ldapbind = ldap_bind($con);
  if ($ldapbind){
    //echo "Bind OK";
    $search = ldap_search($con, $basedn, "(cn=*)");
    echo "LDAP Entries:" . ldap_count_entries($con, $search);
  }
  else
    echo "No bind";
  ldap_unbind($con);
}
else
  echo "Not connected";

Expected result:
----------------
I would like to specify at ldap_connect($host, $time) and/or
ldap_bind($con, $time) the number of seconds that request could be hanged
on, while not expires.



Actual result:
--------------
As the only time limit is avaliable at ldap_search function, or even
ldap_set_option, if there are a lot of entries to be handled, the request
is being hanged on a very long time (TCP/IP connection).

-- 
Edit bug report at http://bugs.php.net/?id=42837&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42837&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42837&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42837&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42837&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42837&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42837&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42837&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42837&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42837&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42837&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42837&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42837&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42837&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42837&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42837&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42837&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42837&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42837&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42837&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42837&r=mysqlcfg

Reply via email to