From 562c22d655ad47e3b39eebcfd2bb3b80e53cf6bf Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Sat, 25 Oct 2003 15:34:39 +0000 Subject: [PATCH] ignore ldap hosts after the first host (i.e., space delimited host lists) until we can make multiple hosts work r=mscott, sr=dmose,a=asa 223603 git-svn-id: svn://10.0.0.236/trunk@148377 18797224-902f-48f8-a5cc-f745e15eee43 --- .../directory/xpcom/base/src/nsLDAPConnection.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mozilla/directory/xpcom/base/src/nsLDAPConnection.cpp b/mozilla/directory/xpcom/base/src/nsLDAPConnection.cpp index af359f349b8..1e8f4a4a401 100644 --- a/mozilla/directory/xpcom/base/src/nsLDAPConnection.cpp +++ b/mozilla/directory/xpcom/base/src/nsLDAPConnection.cpp @@ -234,6 +234,18 @@ nsLDAPConnection::Init(const char *aHost, PRInt32 aPort, PRBool aSSL, return NS_ERROR_FAILURE; } mDNSHost = aHost; + + // if the caller has passed in a space-delimited set of hosts, as the + // ldap c-sdk allows, strip off the trailing hosts for now. + // Soon, we'd like to make multiple hosts work, but now make + // at least the first one work. + mDNSHost.CompressWhitespace(PR_TRUE, PR_TRUE); + + PRInt32 spacePos = mDNSHost.FindChar(' '); + // trim off trailing host(s) + if (spacePos != kNotFound) + mDNSHost.Truncate(spacePos); + rv = pDNSService->AsyncResolve(mDNSHost, PR_FALSE, this, curEventQ, getter_AddRefs(mDNSRequest));