Bug 85452, 100% CPU usage in LDAP autocomplete. r=dmose, sr=mscott,

patch=leif.
This commit is contained in:
leif%netscape.com 2001-08-22 01:30:19 +00:00
Родитель 366b878fb2
Коммит 6af64c6c73
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -561,7 +561,7 @@ nsLDAPConnectionLoop::Run(void)
LDAPMessage *msgHandle;
nsCOMPtr<nsILDAPMessage> msg;
struct timeval timeout = { 1, 0 };
PRIntervalTime sleepTime = PR_MillisecondsToInterval(10);
PRIntervalTime sleepTime = PR_MillisecondsToInterval(40);
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
("nsLDAPConnection::Run() entered\n"));
@ -644,10 +644,19 @@ nsLDAPConnectionLoop::Run(void)
lderrno = ldap_get_lderrno(rawConn->mConnectionHandle, 0, 0);
// Sleep briefly, to avoid a very busy loop again.
//
PR_Sleep(sleepTime);
switch (lderrno) {
case LDAP_SERVER_DOWN:
// XXXreconnect or fail ?
// We might want to shutdown the thread here, but it has
// implications to the user of the nsLDAPConnection, so
// for now we just ignore it. It's up to the owner of
// the nsLDAPConnection to detect the error, and then
// create a new connection.
//
break;
case LDAP_DECODING_ERROR: